★ wanayoo — archive 1999 https://github.com/phpmyadmin/sql-parser/issues/306Nouvelle recherche | Portail wanayoo
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

Syntax error in subquery when used in SET #306

Open
rusakov92 opened this issue Jul 2, 2020 · 1 comment
Open

Syntax error in subquery when used in SET #306

rusakov92 opened this issue Jul 2, 2020 · 1 comment

Comments

@rusakov92
Copy link

@rusakov92 rusakov92 commented Jul 2, 2020

Hello,

I'm using the linter provided in this library and found out that when we use it on this query SET @test := (SELECT 1); it fails when we try to build the object \PhpMyAdmin\SqlParser\Statements\SetStatement from \PhpMyAdmin\SqlParser\Parser with the message "A new statement was found, but no delimiter between it and the previous one.".

The parser fails also when we try to build the \PhpMyAdmin\SqlParser\Statements\SelectStatement because we don't add ; at the end before the ), the error message is "Unexpected token.".

Both of the errors are thrown by \PhpMyAdmin\SqlParser\Statement::parse().

I'm happy to create a PR with a fix for this but I'm not entirely sure how the parsing works, can someone explain it to me and suggest a fix for this?

@williamdes
Copy link
Member

@williamdes williamdes commented Jul 2, 2020

Hello @rusakov92
Thank you for the feedback!
We would be happy to have a pull-request against QA branch
I am afraid not to be able to explain more that the documentation already explains but if you find out on how to fix this we can definitely discuss the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.