-
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 CONSTRAINT syntax #548
Conversation
Merge upstream update
Merge from upstream
Merge from upstream
Codecov Report
@@ Coverage Diff @@
## master #548 +/- ##
==========================================
- Coverage 71.77% 71.76% -0.02%
==========================================
Files 32 32
Lines 7802 7813 +11
==========================================
+ Hits 5600 5607 +7
- Misses 1674 1676 +2
- Partials 528 530 +2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #548 +/- ##
==========================================
- Coverage 71.77% 71.76% -0.02%
==========================================
Files 32 32
Lines 7802 7813 +11
==========================================
+ Hits 5600 5607 +7
- Misses 1674 1676 +2
- Partials 528 530 +2
Continue to review full report at Codecov.
|
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.
Rest LGTM
@tangenta Hi, I've tried hard to increase the coverage, but it still drops, will this block the merge of this PR? BTW, I'll be very appreciated if you could let me know how to increase the coverage. I figued out that it is because I added code in the visit of |
This won't block the merge. To test |
@tangenta @leoppro I've added two more test cases in https://github.com/pingcap/parser/blob/master/ast/ddl_test.go#L26, not sure if it will have effect on improving coverage. But if it won't block the merge, please help review the code and merge it, I guess I won't continue to work on improving coverage. |
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
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
What problem does this PR solve?
Fix #413
What is changed and how it works?
Tests proposed in #413 reflect 2 different aspects of the incompatibility between our parser and MySQL's.
parser.y
to support the syntax, I also added a new attributeNewConstraints
in parallel with already exsitedNewColumns
toAlterTableSpec
, and also added the corresponding restoration and visit code. The modification is based on observation of howCreateTableStmt
is implemented, because the syntax is similar in MySQL'ssql_yacc.yy
and ourparser.y
, and it also uses two different arrayCols
andConstraints
to reflect the 2 different kinds of column definition.sql_yacc.yy
Check List
Tests
Code changes