-
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
parser: support some new syntax #392
Conversation
/run-all-tests |
Codecov Report
@@ Coverage Diff @@
## master #392 +/- ##
========================================
Coverage ? 70.1%
========================================
Files ? 32
Lines ? 7405
Branches ? 0
========================================
Hits ? 5191
Misses ? 1701
Partials ? 513
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #392 +/- ##
==========================================
+ Coverage 70.1% 70.16% +0.05%
==========================================
Files 32 32
Lines 7399 7433 +34
==========================================
+ Hits 5187 5215 +28
- Misses 1700 1703 +3
- Partials 512 515 +3
Continue to review full report at Codecov.
|
@kennytm @tiancaiamao PTAL |
@imtbkcat PTAL |
integration-test fail |
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.
Some code is spaced badly. Rest LGTM.
@kennytm @tiancaiamao PTAL again |
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
LGTM |
support followed syntax:
ALTER TABLE t LOCK [=] lock_type
ALTER TABLE t ALGORITHM [=] algorithm_type
ALTER TABLE t ALTER COLUMN a SET DEFAULT (expr)
ALTER TABLE t ADD CONSTRAINT aaa CHECK (expr) [NOT [ENFORCED]]
CREATE TABLE t (a INT CHECK(expr) [NOT [ENFORCED]])
CREATE TABLE t (a INT CHECK(expr) NOT NULL)
(CHECK only parsed but not implement function)
Here I refer to the implementation of MySQL:
https://github.com/mysql/mysql-server/blob/c000dcf1a9b2ee4a4f986dde08c1f6e1b6461a18/sql/sql_yacc.yy#L6733
BTW: Thanks for the guidance from @kennytm
What problem does this PR solve?
Improve the compatibility of tidb parser
Check List
Tests
i tested
SET DEFAULT (expr)
in tidb which use the parser of this commi.we support const value like : (1+1),(1*1). but we don't support functionexpr like: (now())
Code changes
none
add a new lex token named 'enforced'
none
Side effects
Related changes