-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
affects-4.0This bug affects 4.0.x versions.This bug affects 4.0.x versions.affects-5.0This bug affects 5.0.x versions.This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.This bug affects 5.3.x versions.severity/majorsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATE TABLE `t` (
`a` char(10) DEFAULT NULL
);
CREATE TABLE `t1` (
`a` char(10) COLLATE utf8mb4_general_ci DEFAULT NULL
);
insert into t values ("a");
insert into t1 values ("A");
select * from t where t.a = all (select a collate utf8mb4_general_ci from t1);
select * from t where t.a != any (select a collate utf8mb4_general_ci from t1);
select a as a_col from t where t.a <= all (select a collate utf8mb4_general_ci from t1);
select a as a_col from t where t.a <= any (select a collate utf8mb4_general_ci from t1);
select * from t where t.a = (select a collate utf8mb4_general_ci from t1);2. What did you expect to see? (Required)
mysql> select * from t where t.a = all (select a collate utf8mb4_general_ci from t1);
+------+
| a |
+------+
| a |
+------+
1 row in set (0.00 sec)
mysql> select * from t where t.a != any (select a collate utf8mb4_general_ci from t1);
Empty set (0.00 sec)
mysql> select a as a_col from t where t.a <= all (select a collate utf8mb4_general_ci from t1);
+------+
| a |
+------+
| a |
+------+
1 row in set (0.00 sec)
mysql> select a as a_col from t where t.a <= any (select a collate utf8mb4_general_ci from t1);
+------+
| a |
+------+
| a |
+------+
1 row in set (0.00 sec)
mysql> select * from t where t.a = (select a collate utf8mb4_general_ci from t1);
+------+
| a |
+------+
| a |
+------+
1 row in set (0.00 sec)
3. What did you see instead (Required)
mysql> select * from t where t.a = all (select a collate utf8mb4_general_ci from t1);
Empty set (0.00 sec)
mysql> select * from t where t.a != any (select a collate utf8mb4_general_ci from t1);
+------+
| a |
+------+
| a |
+------+
1 row in set (0.00 sec)
mysql> select a as a_col from t where t.a <= all (select a collate utf8mb4_general_ci from t1);
Empty set (0.00 sec)
mysql> select a as a_col from t where t.a <= any (select a collate utf8mb4_general_ci from t1);
Empty set (0.01 sec)
mysql> select * from t where t.a = (select a collate utf8mb4_general_ci from t1);
Empty set (0.00 sec)4. What is your TiDB version? (Required)
master
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affects-4.0This bug affects 4.0.x versions.This bug affects 4.0.x versions.affects-5.0This bug affects 5.0.x versions.This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.This bug affects 5.3.x versions.severity/majorsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.