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

Can't use @ in SET variable names. #59

Open
cyberhuman opened this issue Dec 13, 2018 · 3 comments
Open

Can't use @ in SET variable names. #59

cyberhuman opened this issue Dec 13, 2018 · 3 comments

Comments

@cyberhuman
Copy link
Contributor

e.g.

SET @noop = 0;

results in

==> SET @noop = 0
Position 1:9 Tokens: @noop = 0
Error: Sqlgg.Sql_parser.MenhirBasics.Error
Errors encountered, no code generated

Note that `@noop` is not the same as @noop (e.g. Mysql would complain that a system variable by that name does not exist, if backticks are used).

@cyberhuman
Copy link
Contributor Author

I have just realized that we can live without noop :-) Closing this.

@ygrek
Copy link
Owner

ygrek commented Dec 14, 2018

It is not straightforward to fix, because while it is possible to parse such set with some hacks, but later when this var is referenced it will be confused with a parameter (because syntax is the same).
I see two ways out : either keep track of all variable names defined and recover them when they are confused for parameters by lexer, or make selection of params syntax exclusive

@ygrek
Copy link
Owner

ygrek commented Dec 14, 2018

reopening as a reminder

@ygrek ygrek reopened this Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants