You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot use MySQL user variables after INTO clause #854
Describe the bug
Using MySQL user variables after the INTO clause in a SELECT is a perfectly valid MySQL query. But the parse is unable to parse such a query.
To Reproduce
Steps to reproduce the behavior:
Example SQL:
SELECTCOUNT(*) INTO @countTotal FROM employee;
Parsing this SQL using JSqlParser with this statements:
try {
StatementuserVariableAfterInto =
CCJSqlParserUtil.parse("SELECT COUNT(*) INTO @countTotal FROM employee;");
} catch (JSQLParserExceptione) {
e.printStackTrace();
}
Exception
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "@""@"
at line 1, column 22.
Was expecting one of:
"ACTION""ANY""BYTE""CASCADE"
Expected behavior
It should be possible to use MySQL user variables after the INTO clause of the SELECT query.
Activity