MySqlConnector icon indicating copy to clipboard operation
MySqlConnector copied to clipboard

ResetConnectionAsync doesn't preserve `character_set_connection`

Open bgrainger opened this issue 3 years ago • 1 comments
trafficstars

ResetConnectionAsync (added in https://github.com/mysql-net/MySqlConnector/commit/ffea49465806367248a88dba93610381a5d1476b for https://github.com/mysql-net/MySqlConnector/issues/831) only sends a connection reset packet. This sets the connection charset to the server default charset, not the initial connection charset: https://bugs.mysql.com/bug.php?id=97633

Consequently, result sets may have the wrong encoding for commands subsequently executed on the connection.

We should abstract away this bug from the consumer by automatically executing SET NAMES. With pipelining (#1088) this won't be any less efficient.

bgrainger avatar Nov 26 '21 02:11 bgrainger

automatically executing SET NAMES

Note that this is unnecessary for MariaDB: https://github.com/mysql-net/MySqlConnector/issues/1236. So the current behaviour is desirable for that DB backend.

bgrainger avatar Dec 21 '22 15:12 bgrainger