Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddl: set column collate from ColumnOptionCollate #9947

Merged
merged 8 commits into from
Apr 22, 2019

Conversation

bb7133
Copy link
Member

@bb7133 bb7133 commented Mar 29, 2019

What problem does this PR solve?

In MySQL CREATE TABLE syntax, column collation is part of the column option, so the following statements are valid(although meaningless):

create table t(a decimal collate utf8_bin)
create table t(a decimal collate utf8_bin collate utf8_general_ci)

This PR makes those statements acceptable

What is changed and how it works?

In TiDB parser, Column "COLLATE" definitions are moved from 'StringType' to 'ColumnOption'(pingcap/parser#260)

This PR uses ColumnOptionCollate to set the collation of a column

Check List

Tests

  • Integration test

Code changes

  • Has interface methods change

Side effects

  • Increased code complexity

Related changes

  • None

@winkyao
Copy link
Contributor

winkyao commented Mar 29, 2019

Please fix ci.

@codecov
Copy link

codecov bot commented Apr 12, 2019

Codecov Report

Merging #9947 into master will increase coverage by 0.0307%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master      #9947        +/-   ##
================================================
+ Coverage   77.9622%   77.9929%   +0.0307%     
================================================
  Files           407        407                
  Lines         83139      83096        -43     
================================================
- Hits          64817      64809         -8     
+ Misses        13521      13499        -22     
+ Partials       4801       4788        -13

@bb7133 bb7133 force-pushed the bb7133/parser_collate branch from 6914532 to 3005680 Compare April 15, 2019 03:54
@bb7133 bb7133 force-pushed the bb7133/parser_collate branch from 3005680 to b080f16 Compare April 15, 2019 07:09
Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@winkyao
Copy link
Contributor

winkyao commented Apr 16, 2019

/run-all-tests

@zz-jason zz-jason added the status/LGT2 Indicates that a PR has LGTM 2. label Apr 21, 2019
@zz-jason zz-jason merged commit 2c192bc into pingcap:master Apr 22, 2019
@bb7133 bb7133 deleted the bb7133/parser_collate branch December 29, 2023 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants