sysown / proxysql

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

SET command enhancements #2331

Open altmannmarcelo opened 5 years ago

altmannmarcelo commented 5 years ago

Adding here to keep track on commands to be added as supported for the new SET algorithm:

2019-10-18 22:07:30 MySQL_Session.cpp:6929:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query. Setting lock_hostgroup. Please report a bug for future enhancements:SET CHARACTER SET utf8
2019-10-18 22:15:46 MySQL_Session.cpp:6929:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query. Setting lock_hostgroup. Please report a bug for future enhancements:SET character_set_connection = 'utf8'
2019-10-18 22:17:11 MySQL_Session.cpp:6929:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query. Setting lock_hostgroup. Please report a bug for future enhancements:SET character_set_client = 'utf8'
2019-10-18 22:18:38 MySQL_Session.cpp:6929:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query. Setting lock_hostgroup. Please report a bug for future enhancements:SET character_set_database = 'utf8'

ProxySQL version 2.0.7-80-g4dd4ef5

PS.: Not really an issue since one can use SET NAMES to change almost all of the above(I think only character_set_database won't ), or even create query rules to rewrite them to SET NAMES.

renecannao commented 5 years ago

Hi @altmannmarcelo , thank you for the report. We are working on correctly handling SET CHARACTER SET , and future versions will handle all/most of the session variables. Out of curiosity, what application/driver is generating these?

altmannmarcelo commented 5 years ago

Hi @renecannao , took some time to get the info back. This customer is using DbVisualizer (https://www.dbvis.com/) . However, they are not sure if the above statements were automatically issued by the tool or the users are setting it as part of a .sql script.

I tested the tool and I can only see it setting below SET statements:

2019-11-04T15:42:40.645394Z  3933 Query SHOW WARNINGS
2019-11-04T15:42:40.833247Z  3933 Query SET NAMES latin1
2019-11-04T15:42:40.991795Z  3933 Query SET character_set_results = NULL
2019-11-04T15:42:41.152597Z  3933 Query SET autocommit=1
2019-11-04T15:42:41.344037Z  3933 Query SET autocommit=1

Thanks

twoixter commented 5 years ago

I would like to add some SET errors we're getting:

[...]
2019-11-04 22:39:40 MySQL_Session.cpp:6929:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query. Setting lock_hostgroup. Please report a bug for future enhancements:SET @@group_concat_max_len = 10240
2019-11-04 22:39:41 MySQL_Session.cpp:6929:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query. Setting lock_hostgroup. Please report a bug for future enhancements:SET @@group_concat_max_len = 10240
2019-11-04 22:39:53 MySQL_Session.cpp:6929:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query. Setting lock_hostgroup. Please report a bug for future enhancements:SET @@group_concat_max_len = 10240
2019-11-04 22:39:54 MySQL_Session.cpp:6929:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query. Setting lock_hostgroup. Please report a bug for future enhancements:SET @@group_concat_max_len = 10240
[...]

In our case we can add this setting directly to the config files so that we'll not be issuing SET statements on clients, just notifying if the addition of the global @@ keyword makes any difference.

Mike-the-one commented 3 years ago

Hi @altmannmarcelo , thank you for the report. We are working on correctly handling SET CHARACTER SET , and future versions will handle all/most of the session variables. Out of curiosity, what application/driver is generating these?

Hi, @renecannao is this done? I am also having this issue