-
Notifications
You must be signed in to change notification settings - Fork 640
MySQL: CREATE INDEx
: allow USING
clause before ON
#2029
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
base: main
Are you sure you want to change the base?
Conversation
MySQL allows specifying the index type `USING index_type` before the `ON` clause in `CREATE INDEX` statements. This PR allows the `CREATE INDEX` parser to accept both positions of the `USING` clause, regardless of the dialect. docs: https://dev.mysql.com/doc/refman/8.4/en/create-index.html
let concurrently = self.parse_keyword(Keyword::CONCURRENTLY); | ||
let if_not_exists = self.parse_keywords(&[Keyword::IF, Keyword::NOT, Keyword::EXISTS]); | ||
|
||
let mut using = None; |
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.
Not a fan of this mut
but also not a fan of returning a tuple of (index_name, using) at line 7067.
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.
Seems okay IMO.
The second test in parse_create_index_using_before_on was redundant.
let concurrently = self.parse_keyword(Keyword::CONCURRENTLY); | ||
let if_not_exists = self.parse_keywords(&[Keyword::IF, Keyword::NOT, Keyword::EXISTS]); | ||
|
||
let mut using = None; |
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.
Seems okay IMO.
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.
Great, thanks!
CREATE INDEx
: allow USING
clause before ON
MySQL allows specifying the index type
USING index_type
before theON
clause inCREATE INDEX
statements.This PR allows the
CREATE INDEX
parser to accept both positions of theUSING
clause, regardless of the dialect.docs: https://dev.mysql.com/doc/refman/8.4/en/create-index.html