sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
5.95k stars 971 forks source link

Syntax Error When Setting Variables in ProxySQL #2076

Open maggieliu1999 opened 5 years ago

maggieliu1999 commented 5 years ago

MySQL: 5.7.10 ProxySQL: 2.0.4 CentOS 7

We got syntax error when running migration project from Flyway. Here is the tests we ran in order to reproduce:

mysql -u sysbench -pxxxxx -h 127.0.0.1 -P3306

mysql> set autocommit=1,sql_mode=concat(@@sql_mode,',STRICT_TRANS_TABLES'); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cat(@@sql_mode,',strict_trans_tables')' at line 1

mysql> set autocommit=1, wait_timeout=30; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql> set autocommit=1, wait_timeout=30' at line 1

But same commands work fine in MySQL server directly:

mysql> set autocommit=1, sql_mode = concat(@@sql_mode,',STRICT_TRANS_TABLES'); Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> set autocommit=1, wait_timeout=30; Query OK, 0 rows affected (0.00 sec)

How do we go over this issue? Is there any config parameter from ProxySQL side to resolve this discrepancy ?

Thank you in advance.

yakirgb commented 5 years ago

@maggieliu1999 i think the following PR can help to your issue: https://github.com/sysown/proxysql/pull/2078