Open markosutic opened 4 years ago
I confirm the issue. There are actually a series of issues here, 2 related to the parser and 1 related to session tracking. To make it work, you need to create this rule:
INSERT INTO mysql_query_rules (active,match_pattern,replace_pattern) VALUES (1,"session_track_schema=1, sql_mode = concat\(@@sql_mode,',STRICT_TRANS_TABLES'\),net_write_timeout=1800","net_write_timeout=1800, sql_mode = concat(@@sql_mode,',STRICT_TRANS_TABLES')");
Please make attention to whitespaces!
Also, the above query rewrite disables session_track_schema
: ProxySQL doesn't support it.
Hello Rene, Thank you for a quick response. Workaround you noted solves our issue.
Best regards, Marko
Hi Marko,
Glad to hear the workaround worked. I am reopening the issue, because this is still a bug even if a workaround exists. Thanks
I just wanted to add a note that we run into the same error when we're trying to use proxysql 2.1.1, while 2.0.16 works fine (yeah, that's strange).
MySQL_Session.cpp:7054:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query from client 10.127.38.185:64693. Setting lock_hostgroup. Please report a bug for future enhancements:set autocommit=1, session_track_schema=1, sql_mode = concat(@@sql_mode,',STRICT_TRANS_TABLES')
Hi @markuman . Please consider the behavior in 2.1.1 to be the correct one. 2.0.16 wasn't working fine, it was just not detecting the real issue. Please use the query rule suggested above. Thanks
here is an ansible task from the above suggestion for our error msg.
- name: eleminate session_track_schema=1 from mariadb jdbc connections
proxysql_query_rules:
match_pattern: session_track_schema=1, sql_mode = concat\(@@sql_mode,',STRICT_TRANS_TABLES'\)
replace_pattern: sql_mode = concat(@@sql_mode,',STRICT_TRANS_TABLES')
active: 1
retries: 3
state: present
load_to_runtime: yes
save_to_disk: yes
Hello,
OS: Ubuntu 18.04 ProxySQL: ProxySQL version 2.0.8-67-g877cab1e, codename Truls DB: MariaDB Galera Cluster 10.2.26
We are having ERROR 1064 after successfully running command:
set autocommit=1, session_track_schema=1, sql_mode = concat(@@sql_mode,',STRICT_TRANS_TABLES'),net_write_timeout=1800;
Test:
ProxySQL log:
Application log:
When running query excluding SQL_MODE everything works fine.
We don't have any problems when running queries directly on the database.
Can you please explain how can we workaround this problem?
Thanks
Best regards, Marko