Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse unknown SET query, and can not connect database through proxysql #4268

Closed
cataglyphis opened this issue Jun 25, 2023 · 2 comments

Comments

@cataglyphis
Copy link

  • ProxySQL version: 2.5.2-217-g7f727b3
  • MySQL version: 8.0.33

some services failed to connect to database when try to set character variable value with proxysql.

ProxySQL Log

2023-06-20 02:12:30 MySQL_Session.cpp:7841:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query from client 10.100.2.0:16941. Setting lock_hostgroup. Please report a bug for future enhancements:SET character_set_connection=utf8,character_set_results=utf8,character_set_client=binary
2023-06-20 02:13:34 MySQL_Session.cpp:7841:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query from client 10.100.1.0:31777. Setting lock_hostgroup. Please report a bug for future enhancements:SET character_set_connection=utf8,character_set_results=utf8,character_set_client=binary
2023-06-20 02:18:57 MySQL_Session.cpp:7841:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query from client 10.100.6.1:1526. Setting lock_hostgroup. Please report a bug for future enhancements:SET character_set_connection=utf8,character_set_results=utf8,character_set_client=binary
2023-06-20 02:18:57 MySQL_Session.cpp:7841:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query from client 10.100.6.1:1506. Setting lock_hostgroup. Please report a bug for future enhancements:SET character_set_connection=utf8,character_set_results=utf8,character_set_client=binary
2023-06-20 02:20:00 MySQL_Session.cpp:7841:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query from client 10.100.2.0:58158. Setting lock_hostgroup. Please report a bug for future enhancements:SET character_set_connection=utf8,character_set_results=utf8,character_set_client=binary
2023-06-20 02:20:00 MySQL_Session.cpp:7841:unable_to_parse_set_statement(): [WARNING] Unable to parse unknown SET query from client 10.100.2.0:4120. Setting lock_hostgroup. Please report a bug for future enhancements:SET character_set_connection=utf8,character_set_results=utf8,character_set_client=binary

ProxySQL

mysql db_maidian@localhost:(none)> SET character_set_connection=utf8,character_set_results=utf8,character_set_client=binary;
Query OK, 0 rows affected
Time: 0.001s
mysql db_maidian@localhost:(none)> select version();
(9006, 'ProxySQL Error: connection is locked to hostgroup 1 but trying to reach hostgroup 2')
mysql db_maidian@localhost:(none)>

But if I set character one by one, then everything works well.

mysql db_maidian@localhost:(none)> SET character_set_connection=utf8
Query OK, 0 rows affected
Time: 0.001s
mysql db_maidian@localhost:(none)> select version();
+-----------+
| version() |
+-----------+
| 8.0.33    |
+-----------+
1 row in set
Time: 0.009s
mysql db_maidian@localhost:(none)> SET character_set_results=utf8
Query OK, 0 rows affected
Time: 0.001s
mysql db_maidian@localhost:(none)> select version();
+-----------+
| version() |
+-----------+
| 8.0.33    |
+-----------+
1 row in set
Time: 0.007s
mysql db_maidian@localhost:(none)> SET character_set_client=binary
Query OK, 0 rows affected
Time: 0.001s
mysql db_maidian@localhost:(none)> select version();
+-----------+
| version() |
+-----------+
| 8.0.33    |
+-----------+
1 row in set
Time: 0.006s
@renecannao
Copy link
Contributor

Hi @cataglyphis .
It seems a bug in the way proxysql performs the parsing.

For now, please use spaces like this:

SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary;

Thanks.

@cataglyphis
Copy link
Author

SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary;

Thanks, this works well.

mysql root@localhost:bbl_core_db> SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary;
Query OK, 0 rows affected
Time: 0.001s
mysql root@localhost:bbl_core_db> select version();
+-----------+
| version() |
+-----------+
| 8.0.33    |
+-----------+
1 row in set
Time: 0.007s
mysql root@localhost:bbl_core_db> SET character_set_connection=utf8,character_set_results=utf8,character_set_client=binary;
Query OK, 0 rows affected
Time: 0.002s
mysql root@localhost:bbl_core_db> select version();
(9006, 'ProxySQL Error: connection is locked to hostgroup 1 but trying to reach hostgroup 2')
mysql root@localhost:bbl_core_db>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants