Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
Description
mysql console command doesn't detect console encoding like it was before 10.2.
When default-character-set is not set, the default value is 'auto'.
'auto' before 10.2 means rely on API "mysql_autodetect_character_set" that detect console encoding.
Since 10.2, regression is that 'auto' is not handled, defaulting to build option DEFAULT_CHARSET is was set, latin1 if not.
console client charset can then be wrong
Example on windows that default to cp850:
C:\Users\diego>"C:\Program Files\MariaDB 10.3\bin\mysql.exe" -udiego --host=192.168.0.45 --default-character-set=auto
|
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
Your MariaDB connection id is 124
|
Server version: 10.4.5-MariaDB-1:10.4.5+maria~bionic-log mariadb.org binary distribution
|
|
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
|
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
|
MariaDB [(none)]> SELECT HEX('é'), HEX(CONVERT('é' USING utf8)), @@character_set_client;
|
+----------+------------------------------+------------------------+
|
| HEX('é') | HEX(CONVERT('é' USING utf8)) | @@character_set_client |
|
+----------+------------------------------+------------------------+
|
| 82 | E2809A | latin1 |
|
+----------+------------------------------+------------------------+
|
1 row in set (0.006 sec)
|
good results would have been
C3A9 for HEX(CONVERT('é' USING utf8)) , cp850 for @@character_set_client