-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-8.5This bug affects the 8.5.x(LTS) versions.This bug affects the 8.5.x(LTS) versions.impact/wrong-resultseverity/criticalsig/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 int,
b int,
key ab(a, b)
);
insert into t values (100, 500);
set @@tidb_opt_fix_control = "54337:OFF";
select 1 from t where ((a>100) or (a=100 and b>0)) and ((a<100) or (a=100 and b<10));
set @@tidb_opt_fix_control = "54337:ON";
select 1 from t where ((a>100) or (a=100 and b>0)) and ((a<100) or (a=100 and b<10));
2. What did you expect to see? (Required)
These 2 queries above should output the same results.
3. What did you see instead (Required)
The second query has a different output after enabling fix-54337:
mysql> set @@tidb_opt_fix_control = "54337:OFF";
Query OK, 0 rows affected (0.00 sec)
mysql> select 1 from t where ((a>100) or (a=100 and b>0)) and ((a<100) or (a=100 and b<10));
Empty set (0.00 sec)
mysql> set @@tidb_opt_fix_control = "54337:ON";
Query OK, 0 rows affected (0.00 sec)
mysql> select 1 from t where ((a>100) or (a=100 and b>0)) and ((a<100) or (a=100 and b<10));
+---+
| 1 |
+---+
| 1 |
| 1 |
+---+
4. What is your TiDB version? (Required)
Master Branch.
Metadata
Metadata
Assignees
Labels
affects-8.5This bug affects the 8.5.x(LTS) versions.This bug affects the 8.5.x(LTS) versions.impact/wrong-resultseverity/criticalsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.