-
-
Notifications
You must be signed in to change notification settings - Fork 105
ALTER TABLE … MODIFY … ENUM('<reserved_keyword>')
is being wrongly parsed.
#478
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
Comments
Could be related to #450 and it's fix |
This occurs on the latest version of sql-parser (5.8.0 as of today), so either this is not fixed, not related to #450, nor the fix is not yet released 🙂 I'm not sure this is related TBH, as OP of #450 talked about missing commas, while my issue here is really about the parser (or the lexer?) not being aware that the strings in the ENUM are actually not reserved symbols or keywords for statements. |
Did I break something? 😅 |
Well, more tests are needed to know for sure ^^ |
Some tests are added in #485 's 1st commit to show that using values in the ENUM like |
Ok, wait a minute, I screwed up something. I just forgot to add the unit tests dataset I created 😅 . After actually adding them, the fix doesn't work. That is because we are entering the We are just "lucky" to enter in this "if" block when using "SET" as a type, making no difference between "SET" as a type, and "SET" as a statement. I'll fix that in a moment. |
OK, that is fixed now. One of the side effect is that the tokens describing the If that's an issue to not have the tokens in this case, I would suggest to create another issue IMO, as this also affected the |
When trying to parse a statement like this:
SQL-Parser fails because it considers each value of the enum as a real keyword, instead of a simple string. Hence, next operations on the
ALTER TABLE
statements are not understood correctly, and it makes fail the parser.This causes:
Thanks 🙂
The text was updated successfully, but these errors were encountered: