-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.epic/hintreport/customerCustomers have encountered this bug.Customers have encountered this bug.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 int);
insert into t values (1);
insert into t values (1);
mysql> select /*+ set_var(max_execution_time=100) */ a, sleep(1) from t;
ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded
mysql> select /*+ set_var(max_execution_time=100) */ a, sleep(1) from t union all select a, 1 from t;
+------+----------+
| a | sleep(1) |
+------+----------+
| 1 | 1 |
| 1 | 1 |
| 1 | 0 |
| 1 | 0 |
+------+----------+
4 rows in set (2.01 sec)
2. What did you expect to see? (Required)
The second query should return an error.
3. What did you see instead (Required)
The second query's execution time exceeds the limitation.
The reason is that UNION ALL's node is not considered when extracting statement hints:
4. What is your TiDB version? (Required)
Master
Metadata
Metadata
Assignees
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.epic/hintreport/customerCustomers have encountered this bug.Customers have encountered this bug.severity/majorsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.