-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.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/hintseverity/moderatesig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
When there is an invalid hint in a hint set, the behaviour in TiDB is different than MySQL. MySQL respects the other valid hints while TiDB ignore all the hints in the set.
1. Minimal reproduce step (Required)
mysql> SELECT /*+ MAX_EXECUTION_TIME(10) */ SLEEP(5);
mysql> SELECT /*+ MAX_EXECUTION_TIME(10), dtc(name=tt) */ SLEEP(5);
2. What did you expect to see? (Required)
Result from MySQL : Server version: 5.7.44 MySQL Community Server (GPL)
mysql> SELECT /*+ MAX_EXECUTION_TIME(10) */ SLEEP(5);
+----------+
| SLEEP(5) |
+----------+
| 1 |
+----------+
1 row in set (0.01 sec)
mysql> SELECT /*+ MAX_EXECUTION_TIME(10), dtc(name=tt) */ SLEEP(5);
+----------+
| SLEEP(5) |
+----------+
| 1 |
+----------+
1 row in set, 1 warning (0.01 sec) <- hint MAX_EXECUTION_TIME(5) was respected
3. What did you see instead (Required)
Result from TiDB v6.5.4
mysql> SELECT /*+ MAX_EXECUTION_TIME(5) */ SLEEP(5);
--------------
SELECT /*+ MAX_EXECUTION_TIME(5) */ SLEEP(5)
--------------
+----------+
| SLEEP(5) |
+----------+
| 1 |
+----------+
1 row in set (0.07 sec)
mysql> SELECT /*+ MAX_EXECUTION_TIME(5), dtc(name=tt) */ SLEEP(5);
--------------
SELECT /*+ MAX_EXECUTION_TIME(5), dtc(name=tt) */ SLEEP(5)
--------------
+----------+
| SLEEP(5) |
+----------+
| 0 |
+----------+
1 row in set, 1 warning (5.00 sec) <-- hint MAX_EXECUTION_TIME(5) was ignored
4. What is your TiDB version? (Required)
6.5.4
Metadata
Metadata
Assignees
Labels
affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.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/hintseverity/moderatesig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.