sysown / proxysql

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

Unable to parse query: SET time_zone = ?; #4015

Open kirill-voronov opened 1 year ago

kirill-voronov commented 1 year ago

Hello, I run into error

MySQL_Session.cpp:6290:handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY_qpo(): [ERROR] Unable to parse query. If correct, report it as a bug: SET time_zone = ?;

and tried to fix with query rule

INSERT INTO mysql_query_rules (active, match_digest, multiplex, apply)
VALUES (1, '^SET time_zone = ?;', 0, 1);

but it doesn't seem to work, I still have same messages in error log.

ProxySQL version: 2.4.4-44-g3b13c7c, codename Truls OS version: AlmaLinux-9

I use PDO to perform this query:

$gmtOffset = '+04:00';
$connection = new Pdo(
     [
        'host' => '...',
        'port' => '...',
        'dbname' => '...',
        'username' => '...',
        'password' => '...',
    ]
);
$connection->query( 'SET time_zone = :tz;', [ 'tz' => $gmtOffset]);
renecannao commented 1 year ago

Hi @kirill-voronov . Is the query being sent as a prepared statement?

kirill-voronov commented 1 year ago

Yes, method $connection->query(.. prepares and runs the statement

kirill-voronov commented 1 year ago

I also get

MySQL_PreparedStatement.cpp:388:update_metadata(): [WARNING] Updating metadata for stmt 93 , user php_shard_0_read, query SHOW SLAVE STATUS

when execute

$connection->query('SHOW SLAVE STATUS');

Everything else seems to be fine, I get proper data from db and so on, but those messages presents in error log.

pipozzz commented 11 months ago

I'm experiencing the same issue:

Unable to parse query. If correct, report it as a bug: SET SESSION time_zone = 'Europe/Amsterdam';