Skip to content

Some hints do not take effect for cached plan #45812

@you06

Description

@you06

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Prepare sysbench table with 1,000,000 rows.

mysql> prepare stmt from 'select /*+ MAX_EXECUTION_TIME(1) */ sum(id) from sbtest1';
Query OK, 0 rows affected (0.00 sec)

mysql> execute stmt;
mysql> execute stmt; -- run it two times

2. What did you expect to see? (Required)

mysql> execute stmt;
ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded
mysql> execute stmt;
ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded

3. What did you see instead (Required)

mysql> execute stmt;
ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded
mysql> execute stmt;
+--------------+
| sum(id)      |
+--------------+
| 501229432608 |
+--------------+
1 row in set (0.34 sec)

The second time executing this statament, the hint /*+ MAX_EXECUTION_TIME(1) */ do not take effect.

4. What is your TiDB version? (Required)

Release Version: v7.4.0-alpha
Edition: Community
Git Commit Hash: 522a00840385dfa43509a3af2bc79e6ff50252a8
Git Branch: heads/refs/tags/v7.4.0-alpha
UTC Build Time: 2023-08-03 14:26:07
GoVersion: go1.20.7
Race Enabled: false
Check Table Before Drop: false
Store: tikv

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions