-
Notifications
You must be signed in to change notification settings - Fork 410
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
Ambiguous grammar error when BETWEEN followed by two AND keywords #534
Labels
Comments
nene
changed the title
Parse error: Ambiguous grammar - "SELECT" Following "BETWEEN"?
Ambiguous grammar error when BETWEEN followed by two AND keywords
Dec 15, 2022
Thanks for reporting, unfortunately haven't had time to tackle this problem. The actual culprit here is this sort of expression: ... BETWEEN ... AND ... AND ... The parser is getting confused whether it should parse it as: (... BETWEEN ... AND ...) AND ...
... BETWEEN (... AND ...) AND ...
... BETWEEN ... AND (... AND ...) a workaround for now is to supply your own extra parenthesis, like: WHERE
(SYSDATE BETWEEN '2022-11-28 00:00:00' AND '2022-11-28 23:59:59')
AND (SELECT 1 FROM DUAL) |
nene
added a commit
that referenced
this issue
Feb 17, 2023
Fixes a long-standing bug which resulted in ambiguous grammar. The solution involves adding multiple new parser rules which exclude the AND/OR/XOR operators from expressions inside the BETWEEN-expression. This solution is far from elegant. Really it's plain ugly, but at least it gets the bug fixed. I think there's no good way to fix it in the current parser/formatter architecture. Fixes #534
This long-standing bug is now finally fixed in 12.1.1 release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Raises error:
Doesn't raise error:
Expected behavior
Format. :)
Actual behavior
Raised error:
Usage
The text was updated successfully, but these errors were encountered: