[MXS-2784] Default charset is not correct Created: 2019-11-29  Updated: 2020-01-24  Resolved: 2020-01-24

Status: Closed
Project: MariaDB MaxScale
Component/s: Monitor
Affects Version/s: 2.3.14
Fix Version/s: 2.3.17, 2.4.7, 2.5.0

Type: Bug Priority: Major
Reporter: dapeng huang Assignee: markus makela
Resolution: Fixed Votes: 1
Labels: None


 Description   

There are two problems with charset:

1. For 2.3, the mariadb-c-connector version is v3.1.0, after v3.0.4 , mariadb-c-connector changed the default charset logical, the default charset will be latin1, so the function `mysql_get_character_set_info` will alway return latin1;
https://mariadb.com/kb/en/library/mariadb-connector-c-305-release-notes/
CONC-315: Change default character set to latin1

2. User can change the backend's charset setting, but using mysql_get_character_set_info will always get charset of monitor's connection;

Suggestion:
use query "select @@global.character_set_server"



 Comments   
Comment by Georg Richter [ 2020-01-23 ]

The client should always set the character set, since the character set returned by server during the connection handshake presents the value of character_set_server, but not the character sets which will be sent to client.

As documented the preferred way is to use api function `mysql_set_character_set()`. The alternative would be executing the SQL statement `SET NAMES=charset` and enabling session_tracking: For better performance Connector/C doesn't parse SQL statements, so for detecting character set changes session_tracking needs to be enabled.

Generated at Thu Feb 08 04:16:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.