boostorg / mysql

MySQL C++ client based on Boost.Asio
https://www.boost.org/doc/libs/master/libs/mysql
Boost Software License 1.0
257 stars 33 forks source link

Reliable way to set the character set for pooled connections #187

Closed anarthal closed 8 months ago

anarthal commented 11 months ago

connection_pool employs async_reset_connection, which discards character set settings used during connection establishment (sigh). This makes the connection use the server's default character set (as given by SELECT @@global.character_set_client, @@global.character_set_connection, @@global.character_set_results;), which is, in most cases, latin1 (sigh).

pool_params should probably have a std::string charset parameter to run a SET NAMES statement on connection establishment and reset.

Descoped from #19.