Skip to content

Commit

Permalink
MDEV-22217 Make OS character sets "utf8" and "utf-8" map to MariaDB c…
Browse files Browse the repository at this point in the history
…haracter set "utf8mb4"

Map Unix utf8 locales to utf8mb4 instead of utf8mb3.
  • Loading branch information
abarkov committed Jan 22, 2025
1 parent e11592a commit 89f5d28
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
15 changes: 14 additions & 1 deletion mysql-test/main/mysql_locale_posix.result
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Database: ó

utf8
@@character_set_client
utf8mb3
utf8mb4
Database: ó
+--------+
| Tables |
Expand Down Expand Up @@ -70,3 +70,16 @@ DROP DATABASE `ó`;
DROP DATABASE `Ăł`;
DROP DATABASE `цЁ`;
DROP DATABASE `ó`;
#
# Start of 11.8 tests
#
#
# MDEV-22217 Make OS character sets "utf8" and "utf-8" map to MariaDB character set "utf8mb4"
#
VARIABLE_NAME VARIABLE_VALUE
CHARACTER_SET_CLIENT utf8mb4
CHARACTER_SET_CONNECTION utf8mb4
CHARACTER_SET_RESULTS utf8mb4
#
# End of 11.8 tests
#
14 changes: 14 additions & 0 deletions mysql-test/main/mysql_locale_posix.test
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,17 @@ DROP DATABASE `ó`;
DROP DATABASE `Ăł`;
DROP DATABASE `цЁ`;
DROP DATABASE `ó`;

--echo #
--echo # Start of 11.8 tests
--echo #

--echo #
--echo # MDEV-22217 Make OS character sets "utf8" and "utf-8" map to MariaDB character set "utf8mb4"
--echo #

--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"

--echo #
--echo # End of 11.8 tests
--echo #
4 changes: 2 additions & 2 deletions mysys/charset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,8 +1564,8 @@ static const MY_CSET_OS_NAME charsets[] =

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

{"utf8", "utf8", my_cs_exact},
{"utf-8", "utf8", my_cs_exact},
{"utf8", "utf8mb4", my_cs_exact},
{"utf-8", "utf8mb4", my_cs_exact},
#endif
{NULL, NULL, 0}
};
Expand Down

0 comments on commit 89f5d28

Please sign in to comment.