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 |
kennytm
left a comment
There was a problem hiding this comment.
Some code is spaced badly. Rest LGTM.
|
@kennytm @tiancaiamao PTAL again |
|
LGTM |
support followed syntax:
ALTER TABLE t LOCK [=] lock_typeALTER TABLE t ALGORITHM [=] algorithm_typeALTER 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