-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
With new_collation_enabled
is True
create table t(a varchar(32)) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
insert into t values('ʞ');
select binary upper('ʞ');
select binary upper(a) from t;
select distinct upper(a) from t;
2. What did you expect to see? (Required)
mysql> select binary upper('ʞ');
+----------------------------------------+
| binary upper('ʞ') |
+----------------------------------------+
| 0xEA9EB0 |
+----------------------------------------+
1 row in set (0.03 sec)
mysql> select binary upper(a) from t;
+----------------------------------+
| binary upper(a) |
+----------------------------------+
| 0xEA9EB0 |
+----------------------------------+
1 row in set (0.03 sec)
mysql> select distinct upper(a) from t;
+----------+
| upper(a) |
+----------+
| Ʞ |
+----------+
1 row in set (1.76 sec)
3. What did you see instead (Required)
mysql> select binary upper('ʞ');
+----------------------------------------+
| binary upper('ʞ') |
+----------------------------------------+
| 0xEA9EB0 |
+----------------------------------------+
1 row in set (0.03 sec)
mysql> select binary upper(a) from t;
+----------------------------------+
| binary upper(a) |
+----------------------------------+
| 0xEA9E |
+----------------------------------+
1 row in set (0.03 sec)
mysql> select distinct upper(a) from t;
ERROR 1105 (HY000): runtime error: index out of range [2] with length 2
4. What is your TiDB version? (Required)
master. But I think it effects all tidb versions
mysql> SELECT tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.16.3
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.03 sec)