sysown / proxysql

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

Proxysql failing to set session variable #2097

Closed krishmanoh closed 5 years ago

krishmanoh commented 5 years ago

MySQL_Session.cpp:3860:handler_status_WAITING_CLIENTDATASTATE_SLEEP___MYSQL_COM_QUERY_qpo(): [ERROR] Unable to parse query. If correct, report it as a bug: SET SESSION SQL_MODE='STRICT_TRANS_TABLES,PIPES_AS_CONCAT',SESSION INTERPRETER_MODE='INTERPRET_FIRST'

This is correct, not sure why proxysql fails to handle it. It works fine with a single session variable.

proxysql --version ProxySQL version 1.4.9-percona-1.1, codename Truls

This happens when using as part of jdbc url - this works when connecting directly to mysql.

"jdbc:mysql://172.32.10.5:3306/crud_demo_ad?jdbcCompliantTruncation=false&maxAllowedPacket=1024000&sessionVariables=sql_mode='STRICT_TRANS_TABLES,PIPES_AS_CONCAT',interpreter_mode='interpret_first'", "root", "xxxx");

yakirgb commented 5 years ago

Is it working without interpreter_mode='interpret_first'? Try: "jdbc:mysql://172.32.10.5:3306/crud_demo_ad?jdbcCompliantTruncation=false&maxAllowedPacket=1024000&sessionVariables=sql_mode='STRICT_TRANS_TABLES,PIPES_AS_CONCAT'", "root", "xxxx");

krishmanoh commented 5 years ago

Yes, it does.

yakirgb commented 5 years ago

interpreter_mode is parameter of MemSQL and not MySQL

krishmanoh commented 5 years ago

Does proxysql validate the session variables before passing it to the database?

yakirgb commented 5 years ago

See: https://github.com/sysown/proxysql/wiki/Multiplexing#not-handled-session-variables

renecannao commented 5 years ago

Closing. Thank you @yakirgb for the help