-
Notifications
You must be signed in to change notification settings - Fork 490
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
*: add IF EXISTS
and IF NOT EXISTS
supported for MariaDB
#337
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ists # Conflicts: # parser.go
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
@csuzhangxc Is there a corresponding TiDB PR? Otherwise supporting these in the parser level would be misleading. |
@kennytm not yet, but I'll open one. |
LGTM @winkyao |
…ists # Conflicts: # parser.go
@kennytm @tiancaiamao PTAL again I also add:
|
@csuzhangxc Just parse it and ignore it? |
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
Would you like to update |
…ists # Conflicts: # ast/ddl.go # parser.go # parser.y # parser_test.go
@tiancaiamao updated and resolved the conflicts. |
What problem does this PR solve?
for MaraiDB 10.0.2+,
ALTER TABLE
supportIF EXISTS
andIF NOT EXISTS
clauses for some statements, andCREATE INDEX
also supportIF NOT EXISTS
.see https://mariadb.com/kb/en/library/alter-table/ and https://mariadb.com/kb/en/library/create-index/
What is changed and how it works?
IF EXISTS
forDROP COLUMN
CHANGE COLUMN
MODIFY COLUMN
DROP INDEX
DROP FOREIGN KEY
DROP PARTITION
IF NOT EXISTS
forADD COLUMN
ADD INDEX
ADD FOREIGN KEY
CREATE INDEX
ADD PARTITION
Check List
Tests
Corresponding TiDB PR: pingcap/tidb#10723