-
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 with parser ident #524
Conversation
Codecov Report
@@ Coverage Diff @@
## master #524 +/- ##
==========================================
- Coverage 71.74% 71.74% -0.01%
==========================================
Files 32 32
Lines 7772 7779 +7
==========================================
+ Hits 5576 5581 +5
- Misses 1671 1672 +1
- Partials 525 526 +1
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
@@ -1335,7 +1346,7 @@ func (n *CreateIndexStmt) Restore(ctx *RestoreCtx) error { | |||
} | |||
ctx.WritePlain(")") | |||
|
|||
if n.IndexOption.Tp != model.IndexTypeInvalid || n.IndexOption.KeyBlockSize > 0 || n.IndexOption.Comment != "" || n.IndexOption.Visibility != IndexVisibilityDefault { | |||
if n.IndexOption.Tp != model.IndexTypeInvalid || n.IndexOption.KeyBlockSize > 0 || n.IndexOption.Comment != "" || len(n.IndexOption.ParserName.O) > 0 || n.IndexOption.Visibility != IndexVisibilityDefault { |
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.
This condition is getting too long. Could you refactor this into a method of IndexOption
?
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.
let me have a try
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.
I tried a lot of ways, but they didn't work well because there were so many influences, such as creating table.
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.
Okay.
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 compatibility problem about keyword WITH PARSER parser_name
Issue: #507
MySQL Syntax:
index_option:
...
| WITH PARSER parser_name
Bad SQL Case:
create fulltext index idx on t (a, b) with parser ident
create fulltext index idx on t (a, b) with parser ident comment 'string'
create fulltext index idx on t (a, b) comment 'string' with parser ident
create fulltext index idx on t (a, b) with parser ident lock default
Check List
Tests