Skip to content

Commit 89f5d28

Browse files
committed
MDEV-22217 Make OS character sets "utf8" and "utf-8" map to MariaDB character set "utf8mb4"
Map Unix utf8 locales to utf8mb4 instead of utf8mb3.
1 parent e11592a commit 89f5d28

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

mysql-test/main/mysql_locale_posix.result

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Database: ó
3333

3434
utf8
3535
@@character_set_client
36-
utf8mb3
36+
utf8mb4
3737
Database: ó
3838
+--------+
3939
| Tables |
@@ -70,3 +70,16 @@ DROP DATABASE `ó`;
7070
DROP DATABASE `Ăł`;
7171
DROP DATABASE `цЁ`;
7272
DROP DATABASE `ó`;
73+
#
74+
# Start of 11.8 tests
75+
#
76+
#
77+
# MDEV-22217 Make OS character sets "utf8" and "utf-8" map to MariaDB character set "utf8mb4"
78+
#
79+
VARIABLE_NAME VARIABLE_VALUE
80+
CHARACTER_SET_CLIENT utf8mb4
81+
CHARACTER_SET_CONNECTION utf8mb4
82+
CHARACTER_SET_RESULTS utf8mb4
83+
#
84+
# End of 11.8 tests
85+
#

mysql-test/main/mysql_locale_posix.test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,17 @@ DROP DATABASE `ó`;
203203
DROP DATABASE `Ăł`;
204204
DROP DATABASE `цЁ`;
205205
DROP DATABASE `ó`;
206+
207+
--echo #
208+
--echo # Start of 11.8 tests
209+
--echo #
210+
211+
--echo #
212+
--echo # MDEV-22217 Make OS character sets "utf8" and "utf-8" map to MariaDB character set "utf8mb4"
213+
--echo #
214+
215+
--exec LC_ALL=en_US.utf8 $MYSQL --default-character-set=auto test -e "select * from information_schema.session_variables where variable_name rlike 'character_set_(connection|client|results)' order by variable_name"
216+
217+
--echo #
218+
--echo # End of 11.8 tests
219+
--echo #

mysys/charset.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,8 +1564,8 @@ static const MY_CSET_OS_NAME charsets[] =
15641564

15651565
{"US-ASCII", "latin1", my_cs_approx},
15661566

1567-
{"utf8", "utf8", my_cs_exact},
1568-
{"utf-8", "utf8", my_cs_exact},
1567+
{"utf8", "utf8mb4", my_cs_exact},
1568+
{"utf-8", "utf8mb4", my_cs_exact},
15691569
#endif
15701570
{NULL, NULL, 0}
15711571
};

0 commit comments

Comments
 (0)