【 TiDB 使用环境】生产
【 TiDB 版本】v6.1.0
【遇到的问题】
【复现路径】做过哪些操作出现的问题
【问题现象及影响】
问题如下,默认的TIDB字符集规则为utf8mb4_bin,现需要修改utf8mb4_general_ci,报错如下
mysql> show index from xxxxx
+----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+-----------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression | Clustered |
+----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+-----------+
| xxx | 0 | PRIMARY | 1 | id | A | 0 | NULL | NULL | | BTREE | | | YES | NULL | YES |
| xxx | 0 | unq_e_code | 1 | e_code | A | 0 | NULL | NULL | | BTREE | | | YES | NULL | NO |
+----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+-----------+
2 rows in set (0.01 sec)
mysql>
mysql> alter table xxxx convert to character set utf8mb4 collate utf8mb4_general_ci;
ERROR 8200 (HY000): Unsupported converting collation of column 'e_code' from 'utf8mb4_bin' to 'utf8mb4_general_ci' when index is defined on it.