Description:
Hello MySQL team:
Here is a about charset. Can be repeated in 9.1.0.
How to repeat:
Execute sqls below:
set names utf8mb4;
show variables like '%character_set_connection%';
result is:
+--------------------------+---------+
| Variable_name | Value |
+--------------------------+---------+
| character_set_connection | utf8mb4 |
+--------------------------+---------+
however, if executes:
mysql> set character_set_connection = utf32;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like '%character_set_connection%';
Empty set (0.00 sec)
similarly,
mysql> set character_set_connection = ucs2;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> show variables like '%character_set_connection%';
Empty set (0.01 sec)
Suggested fix:
ucs2 and utf32 is fixed length. for ucs2, constant string '%character_set_connection%' after like, it is decoded as 0x00 0x63.... and stored in str_value member of Item_string although str_value is set other charset(depends on charset of table performance_schema.session_variables).
finally no result get in filter so returns empty set.