-
Notifications
You must be signed in to change notification settings - Fork 489
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
fix alter table convert to charset default syntax #566
Conversation
Codecov Report
@@ Coverage Diff @@
## master #566 +/- ##
======================================
Coverage 80% 80%
======================================
Files 32 32
Lines 12681 12696 +15
======================================
+ Hits 10145 10157 +12
- Misses 1934 1935 +1
- Partials 602 604 +2
Continue to review full report at Codecov.
|
@tiancaiamao PTAL |
LGTM |
PTAL @winkyao |
@@ -1279,6 +1279,17 @@ AlterTableSpec: | |||
} | |||
$$ = op | |||
} | |||
| "CONVERT" "TO" CharsetKw "DEFAULT" OptCollate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It used to parse the CONVERT TO CHARACTER SET chaset_name into [DEFAULT] CHARACTER SET syntax. I think we just want to change only the default character set for a table...
So I reserved it.
I think we need to support all syntaxes rather than CONVERT TO CHARSET DEFAULT
. Please update the codes here for specified character name.
BTW, the current implementation of ALTER TABLE ... DEFAULT CHARSET
in TiDB is wrong, I think we need to fix it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sry, kind of busy these days. I will try to fix the TiDB to support the parser later. And the CONVERT TO CHARSET DEFAULT
is another commits that has been merged. I will fix all the syntaxes as what MySQL do.
hi @sim41 , thanks for the contribution, please check my comments. |
hi @sim41 , could you check the comments and fix conflicts please? |
Ping @sim41 |
01c0cd0
to
9f9036c
Compare
@tiancaiamao @tangenta sry, kind of busy these days. I will fix it this weekends. |
@bb7133 PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
hi @sim41 please resolve the conflict and we can approve your PR, thanks for the contribution! |
9f9036c
to
6333e32
Compare
What problem does this PR solve?
issue:#498
MySQL Syntax:
It used to parse the
CONVERT TO CHARACTER SET
chaset_name into[DEFAULT] CHARACTER SET
syntax. I think we just want to change only the default character set for a table.(https://dev.mysql.com/doc/refman/8.0/en/alter-table.html).
So I reserved it.
Bad SQL Case:
Check List
Tests