Skip to content
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

Robustify syntax error reporting #92

Open
jaypipes opened this issue Apr 18, 2018 · 0 comments
Open

Robustify syntax error reporting #92

jaypipes opened this issue Apr 18, 2018 · 0 comments
Milestone

Comments

@jaypipes
Copy link
Owner

Due the various things, including how the lexer's cursor is moved over time, sometimes the syntax errors produced when a parsing problem happens can be confusing. Por ejemplo:

./sqltoaster/sqltoaster "SELECT NULLIF(a, b) FROM t1"
OK
statements[0]:
  <statement: SELECT
   selected columns:
     0: nullif[column-reference[a],column-reference[b]]
   referenced tables:
     0: t1>

(took 73006 nanoseconds)

If I remove the a,b arguments accidentally, I get the following parser syntax error:

./sqltoaster/sqltoaster "SELECT NULLIF() FROM t1"
Syntax error.
Expected to find one of ('*'|<< identifier >>) but found symbol[')']
SELECT NULLIF() FROM t1
             ^^^^^^^^^^
(took 78092 nanoseconds)

What should be there is a message about how a is expected as the first argument to the NULLIF() function.

@jaypipes jaypipes added this to the 0.3 milestone Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant