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

parser: support of character in create table statement #7378

Merged
merged 4 commits into from Aug 13, 2018

Conversation

@imtbkcat
Copy link
Contributor

commented Aug 13, 2018

What problem does this PR solve?

Fix #7371 to make some JDBC test cases happy.

What is changed and how it works?

Support NATIONAL CHARACTER type in create table statement, like create table t (c1 NATIONAL CHARACTER(10)); by add parser rules. Because NATIONAL CHARACTER is same as NATIONAL CHAR, just change parser is okay.

Reference link: https://dev.mysql.com/doc/refman/5.7/en/charset-national.html

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects
no

Related changes
no

@@ -6094,6 +6094,17 @@ StringType:
}
$$ = x
}
| "NATIONAL" "CHARACTER" FieldLen OptBinary OptCollate

This comment has been minimized.

Copy link
@shenli

shenli Aug 13, 2018

Member

Can we define a new parser rule like:

CharOrCharacter:
     "CHAR" | "CHARACTER"

Then we could merge this into the first branch.

This comment has been minimized.

Copy link
@imtbkcat

imtbkcat Aug 13, 2018

Author Contributor

Ok.

This comment has been minimized.

Copy link
@imtbkcat

imtbkcat Aug 13, 2018

Author Contributor

@shenli
NationalOpt could be empty, "CHAR(10)" is legal, but "CHARACTER(10)" is illegal in MySQL. There must be a "NATIONAL" before "CHARACTER".

This comment has been minimized.

Copy link
@shenli
@coocood

This comment has been minimized.

Copy link
Member

commented Aug 13, 2018

LGTM

@imtbkcat

This comment has been minimized.

Copy link
Contributor Author

commented Aug 13, 2018

/run-all-tests

@shenli
shenli approved these changes Aug 13, 2018
Copy link
Member

left a comment

LGTM

@@ -6094,6 +6094,17 @@ StringType:
}
$$ = x
}
| "NATIONAL" "CHARACTER" FieldLen OptBinary OptCollate

This comment has been minimized.

Copy link
@shenli
shenli added 2 commits Aug 13, 2018
@shenli shenli added status/LGT2 and removed status/LGT1 labels Aug 13, 2018
@shenli shenli merged commit bfceb50 into pingcap:master Aug 13, 2018
4 checks passed
4 checks passed
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.