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
Merged

parser: support of character in create table statement #7378

merged 4 commits into from
Aug 13, 2018

Conversation

imtbkcat
Copy link

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
Copy link
Member

Choose a reason for hiding this comment

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

Can we define a new parser rule like:

CharOrCharacter:
     "CHAR" | "CHARACTER"

Then we could merge this into the first branch.

Copy link
Author

Choose a reason for hiding this comment

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

Ok.

Copy link
Author

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

OK

@coocood
Copy link
Member

coocood commented Aug 13, 2018

LGTM

@imtbkcat
Copy link
Author

/run-all-tests

@imtbkcat imtbkcat added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 13, 2018
Copy link
Member

@shenli shenli left a comment

Choose a reason for hiding this comment

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

LGTM

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

Choose a reason for hiding this comment

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

OK

@shenli shenli added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 13, 2018
@shenli shenli merged commit bfceb50 into pingcap:master Aug 13, 2018
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.

3 participants