1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

MDEV-38991: mysql system schema using my.cnf(configuration) character set

instead of utf8mb3

Analysis:
When loading database options, missing values falls back to the dynamic
server variable thd->variables.collation_server and hence it takes incorrect
value.

Fix:
In case of missing values it should just take the default characterset.
This commit is contained in:
Rucha Deodhar
2026-10-20 00:44:15 -04:00
parent f780d4d912
commit 6019b1cd81
4 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
--character-set-server=latin1
--collation-server=latin1_swedish_ci

View File

@@ -0,0 +1,9 @@
#
# MDEV-38991: mysql system schema using my.cnf(configuration) character set instead of utf8mb3
#
SELECT schema_name, DEFAULT_CHARACTER_SET_NAME, default_collation_name FROM information_schema.schemata WHERE schema_name IN ('sys', 'information_schema', 'mysql', 'performance_schema');
schema_name DEFAULT_CHARACTER_SET_NAME default_collation_name
sys utf8mb3 utf8mb3_general_ci
performance_schema utf8mb3 utf8mb3_general_ci
mysql latin1 latin1_swedish_ci
information_schema utf8mb3 utf8mb3_general_ci

View File

@@ -0,0 +1,5 @@
--echo #
--echo # MDEV-38991: mysql system schema using my.cnf(configuration) character set instead of utf8mb3
--echo #
SELECT schema_name, DEFAULT_CHARACTER_SET_NAME, default_collation_name FROM information_schema.schemata WHERE schema_name IN ('sys', 'information_schema', 'mysql', 'performance_schema');

View File

@@ -671,7 +671,7 @@ err2:
mysql_file_close(file, MYF(0));
err1:
if (!create->default_table_charset) // In case of error
create->default_table_charset= thd->variables.collation_server;
create->default_table_charset= default_charset_info;
DBUG_RETURN(error);
}