You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
set character_set_results = gbk;
create table t(f set(0xD2BB, 0xC8FD), e enum(0xBAEC,0x6A59));
show create table t;
drop table t;
create table t( e enum(0xBAEC,0x6A59));
show create table t;
2. What did you expect to see? (Required)
mysql> show create table t;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`f` set('?','?') DEFAULT NULL,
`e` enum('?','jY') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
mysql> show create table t;
+-------+-------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`e` enum('?','jY') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+-------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
3. What did you see instead (Required)
tidb> show create table t;
+-------+--------------------------------+
| Table | Create Table |
+-------+--------------------------------+
| t | CREATE TABLE `t` (
`f` set(' |
+-------+--------------------------------+
1 row in set (0.01 sec)
tidb> show create table t;
+-------+---------------------------------+
| Table | Create Table |
+-------+---------------------------------+
| t | CREATE TABLE `t` (
`e` enum(' |
+-------+---------------------------------+
1 row in set (0.01 sec)
4. What is your TiDB version? (Required)
| Release Version: v5.5.0-alpha-27-g9acb2c2ad-dirty
Edition: Community
Git Commit Hash: 9acb2c2ad5a3891fd9fb9de27befb986bcc243a7
Git Branch: master
UTC Build Time: 2022-01-05 08:16:38
The text was updated successfully, but these errors were encountered:
This is because the binary literal like 0xD2BB in enum/set can only be decoded to utf8mb4. When the result is written back to the client, an error occurs because 0xD2BB cannot be encoded with gbk. Thus, the result is truncated.
I think we cannot solve this problem until we find a way to decode the binary literal correctly from enum/set.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: