1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-28769 Assertion `(m_ci->state & 32) || m_with_collate' failed in Lex_exact_charset_opt_extended_collate::Lex_exact_charset_opt_extended_collate on SET NAMES

These system variables:
  @@character_set_client
  @@character_set_connection
  @@character_set_database
  @@character_set_filesystem
  @@character_set_results
  @@character_set_server

can now be set in numeric format only to IDs of default collations, e.g.:

SET @@character_set_xxx=9;  -- OK    (latin2_general_ci  is default)
SET @@character_set_xxx=2;  -- ERROR (latin2_czech_cs is not default)
SET @@character_set_xxx=21; -- ERROR (latin2_hungarian_ci is not default)

Before this change the server accepted IDs of non-default collations
so all three examples above worked without errors,
but this could lead to unexpected behavior in later statements.
This commit is contained in:
Alexander Barkov
2022-06-16 10:38:35 +04:00
parent 9fe784ff7e
commit a923d6f49c
13 changed files with 168 additions and 89 deletions

View File

@@ -154,30 +154,42 @@ SELECT @@global.character_set_database;
##############################################################
SET @@character_set_database = 1;
SELECT @@character_set_database;
--echo # latin2_czech_cs is not a default collation
--error ER_UNKNOWN_CHARACTER_SET
SET @@character_set_database = 2;
SELECT @@character_set_database;
SET @@character_set_database = 3;
SELECT @@character_set_database;
SET @@character_set_database = 36;
SELECT @@character_set_database;
SET @@character_set_database = 99;
SELECT @@character_set_database;
--echo # cp1250_polish_ci is not a default collation
--error ER_UNKNOWN_CHARACTER_SET
SET @@character_set_database = 99;
--echo # Collation ID 100 does not exist
--Error ER_UNKNOWN_CHARACTER_SET
SET @@character_set_database = 100;
SET @@global.character_set_database = 1;
SELECT @@global.character_set_database;
--echo # latin2_czech_cs is not a default collation
--error ER_UNKNOWN_CHARACTER_SET
SET @@global.character_set_database = 2;
SELECT @@global.character_set_database;
SET @@global.character_set_database = 3;
SELECT @@global.character_set_database;
SET @@global.character_set_database = 36;
SELECT @@global.character_set_database;
SET @@global.character_set_database = 99;
SELECT @@global.character_set_database;
--echo # cp1250_polish_ci is not a default collation
--error ER_UNKNOWN_CHARACTER_SET
SET @@global.character_set_database = 99;
--echo # Collation ID 100 does not exist
--Error ER_UNKNOWN_CHARACTER_SET
SET @@global.character_set_database = 100;