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
Improve error reporting in SQL #3036
Comments
Key problem is that we have syntax error and fallback error. Fallback is when you use keyword in not appropriate place, for example you can execute next statement:
We have "ABORT" keyword with token type TK_ABORT, we have fallback rule in parse.y which says to fallback TK_ABORT to TK_ID (identifier token type), therefore error doesn't happen. If you try something else without fallback rule, you will get an error. Key of the problem is that parser doesn't separate fallback errors and syntax errors, handling of that situation now is being done in the same parser state. If both happens and last processed keyword is reserved, we will see message 'keyword "KEYWORD" is reserved" like in the example above, not 'syntax error ... '. We need to implement %fallback_error clause for lemon and to distinct fallback error and syntax error and to make syntax error priority higher. |
Here is an example w/ nasty error message.
Testcase:
Error produced:
(error is that closing brace is missing)
The text was updated successfully, but these errors were encountered: