I am using node 5.0.0 along with the node module mysql2 - 1.0.0-rc.11. Everything is working perfectly fine except when I try to use the user defined variables.
Example :
SET @user := 123456;
SELECT * FROM users WHERE user = @user;
The above simple query is throwing syntax error at my end. I am sure that, the syntax is a valid one. So I am wondering what may be the cause for this issue?
Doesn't the node module mysql2 - 1.0.0-rc.11 have support for SET yet? I have scanned the [document1, document2] thoroughly, I couldn't able to find the syntax support list. Can anyone help me to understand what's going wrong with this?
@laraprabhu if you pass this as a single query you have to set multipleStatements flag to true - see https://github.com/mysqljs/mysql#multiple-statement-queries
@sidorares Thank you for your quick reply. The configuration that you have suggested, has fixed the bug in our application.