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 to character option to load data statement #7391

Merged
merged 6 commits into from
Aug 15, 2018
Merged

parser: support to character option to load data statement #7391

merged 6 commits into from
Aug 15, 2018

Conversation

imtbkcat
Copy link

What problem does this PR solve?

Fix #7348 to make some JDBC test cases happy.

What is changed and how it works?

Add a CNF grammar to support CHARACTER SET <charset_name> at the end of LOAD DATA.

Check List

Tests

  • Unit test

Code changes

  • Has exported variable/fields change

Side effects

no

Related changes

parser/parser.y Outdated
@@ -6821,7 +6821,7 @@ RevokeStmt:
* See https://dev.mysql.com/doc/refman/5.7/en/load-data.html
*******************************************************************************************/
LoadDataStmt:
"LOAD" "DATA" LocalOpt "INFILE" stringLit "INTO" "TABLE" TableName Fields Lines ColumnNameListOptWithBrackets
"LOAD" "DATA" LocalOpt "INFILE" stringLit "INTO" "TABLE" TableName Fields Lines ColumnNameListOptWithBrackets CharsetOpt
Copy link
Member

Choose a reason for hiding this comment

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

CharsetOpt should behind TableName.

@imtbkcat
Copy link
Author

/run-all-tests

@imtbkcat
Copy link
Author

PTAL @jackysp

@imtbkcat
Copy link
Author

/run-all-tests

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

@imtbkcat imtbkcat added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 15, 2018
zz-jason
zz-jason previously approved these changes Aug 15, 2018
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

parser/parser.y Outdated
@@ -6821,25 +6821,29 @@ RevokeStmt:
* See https://dev.mysql.com/doc/refman/5.7/en/load-data.html
*******************************************************************************************/
LoadDataStmt:
"LOAD" "DATA" LocalOpt "INFILE" stringLit "INTO" "TABLE" TableName Fields Lines ColumnNameListOptWithBrackets
"LOAD" "DATA" LocalOpt "INFILE" stringLit "INTO" "TABLE" TableName CharsetOpt Fields Lines ColumnNameListOptWithBrackets
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the last space.

@imtbkcat imtbkcat merged commit 4684eec into pingcap:master Aug 15, 2018
@imtbkcat imtbkcat deleted the fix7348 branch August 15, 2018 03:05
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