taozhi8833998 / node-sql-parser

Parse simple SQL statements into an abstract syntax tree (AST) with the visited tableList and convert it back to SQL
https://taozhi8833998.github.io/node-sql-parser/
Apache License 2.0
755 stars 172 forks source link

SET statement with multiple key=value pairs fails to parse #1907

Closed MayamaTakeshi closed 1 month ago

MayamaTakeshi commented 2 months ago

Describe the bug

This

SET @_mystoredprocedure_0='1'

parses successfully. But this:

SET @_mystoredprocedure_0='1',@_mystoredprocedure_1='2'

doesn't. This is used (in mysql at least) to set arguments that will be used in a subsequent call to a stored procedure. So currently, node-sql-parser only works with stored procedures with a single argument, or if the client sets the arguments one by one.

Database Engine mysql

To Reproduce -the SQL that be parsed: "SET @_mystoredprocedure_0='1',@_mystoredprocedure_1='2'" -the node-sql-parser version: 5.1.0 -the node version: v21.2.0