Details
-
Bug
-
Status: In Review (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11
-
Unexpected results
-
Q3/2026 Replic. Maintenance, Q3/2026 Replic. Development
Description
|
GBK encoding |
SET NAMES GBK; |
|
|
SET @@SESSION.default_master_connection= 'Latin'; |
SELECT @@SESSION.default_master_connection , #=> Latin |
CHARSET(@@SESSION.default_master_connection); #=> utf8mb3
|
|
|
SET @@SESSION.default_master_connection= '汉字'; |
SELECT @@SESSION.default_master_connection , #=> ???? |
CHARSET(@@SESSION.default_master_connection); #=> utf8mb3
|
|
|
SET @@GLOBAL.init_slave= '汉字'; # not bugged |
SELECT @@GLOBAL.init_slave , #=> 汉字 |
CHARSET(@@GLOBAL.init_slave); #=> utf8mb3 |
SET @@GLOBAL.init_slave= DEFAULT; |
|
|
SET @mystr= '汉字'; # not affected |
SELECT @mystr , #=> 汉字 |
CHARSET(@mystr); #=> gbk
|
Analysis
Item::val_str() doesn't specify the collation of the returned string.
For example, Item_string::val_str() returns the string behind this item, thus using the collation of the item.
However, Sys_var_session_lexstring::do_check() does not realize this detail and expects the string to be in the @@character_set_system collation.
Sys_var_session_lexstring has been merged away in 11.3 (Commit 6151bde48c); its only instance was @@default_master_connection.
[P.S.]
@@debug_sync has the same mistake and has not been merged away.
@@debug_dbug is not bugged.
Attachments
Issue Links
- blocks
-
MDEV-40295 No warning when string system variables fail to convert character sets
-
- Open
-
- causes
-
MDEV-39757 use-of-uninitialized-value in skip_trailing_space
-
- Closed
-
-
MDEV-39759 use-of-uninitialized-value in bcmp
-
- Closed
-
- relates to
-
MDEV-40271 @@default_master_connection is corrupted if set to a string with null bytes
-
- Needs Feedback
-
- split from
-
MDEV-39757 use-of-uninitialized-value in skip_trailing_space
-
- Closed
-
- split to
-
MDEV-40295 No warning when string system variables fail to convert character sets
-
- Open
-