-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.compatibility-mysql80This is a compatibility issue with MySQL 8.0(but NOT 5.7)This is a compatibility issue with MySQL 8.0(but NOT 5.7)severity/majorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.type/compatibility
Description
Bug Report
SET NAMES utf8mb4
does not change collation_connection
when default_collation_for_utf8mb4
is modified.
1. Minimal reproduce step (Required)
- Startup tiup playground v8.3.0
% mysql --comments --host 127.0.0.1 --port 4000 -u root
- Confirm the default value of
default_collation_for_utf8mb4
mysql> show variables like 'default_collation_for_utf8mb4';
+-------------------------------+-------------+
| Variable_name | Value |
+-------------------------------+-------------+
| default_collation_for_utf8mb4 | utf8mb4_bin |
+-------------------------------+-------------+
1 row in set (0.00 sec)
- Confirm the default value of
collation_connection
mysql> show variables like 'collation_connection';
+----------------------+--------------------+
| Variable_name | Value |
+----------------------+--------------------+
| collation_connection | utf8mb4_general_ci |
+----------------------+--------------------+
1 row in set (0.00 sec)
- Change the
default_collation_for_utf8mb4
value toutf8mb4_general_ci
mysql> set default_collation_for_utf8mb4 = 'utf8mb4_general_ci';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> show variables like 'default_collation_for_utf8mb4';
+-------------------------------+--------------------+
| Variable_name | Value |
+-------------------------------+--------------------+
| default_collation_for_utf8mb4 | utf8mb4_general_ci |
+-------------------------------+--------------------+
1 row in set (0.00 sec)
- Execute
SET NAMES utf8mb4
mysql> SET NAMES utf8mb4;
Query OK, 0 rows affected (0.00 sec)
- Validate the
collation_connection
value afterdefault_collation_for_utf8mb4
has been modified toutf8mb4_general_ci
.
mysql> show variables like 'collation_connection';
+----------------------+-------------+
| Variable_name | Value |
+----------------------+-------------+
| collation_connection | utf8mb4_bin |
+----------------------+-------------+
1 row in set (0.00 sec)
mysql>
2. What did you expect to see? (Required)
The last collation_connection
value should show utf8mb4_general_ci
as default_collation_for_utf8mb4
modified to utf8mb4_general_ci
3. What did you see instead (Required)
The last collation_connection
value shows utf8mb4_bin
.
mysql> show variables like 'default_collation_for_utf8mb4';
+-------------------------------+-------------+
| Variable_name | Value |
+-------------------------------+-------------+
| default_collation_for_utf8mb4 | utf8mb4_bin |
+-------------------------------+-------------+
1 row in set (0.00 sec)
4. What is your TiDB version? (Required)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v8.3.0
Edition: Community
Git Commit Hash: 1a0c3ac3292fff7742faa0c00a662ccb66ba40db
Git Branch: HEAD
UTC Build Time: 2024-08-20 10:23:00
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv
1 row in set (0.00 sec)
mysql>
Metadata
Metadata
Assignees
Labels
affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.compatibility-mysql80This is a compatibility issue with MySQL 8.0(but NOT 5.7)This is a compatibility issue with MySQL 8.0(but NOT 5.7)severity/majorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.type/compatibility