Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max_execution_time hint doesn't work if it exceed the expensive-slow-log-threshold #17393

Closed
qw4990 opened this issue May 25, 2020 · 1 comment · Fixed by #17359
Closed

max_execution_time hint doesn't work if it exceed the expensive-slow-log-threshold #17393

qw4990 opened this issue May 25, 2020 · 1 comment · Fixed by #17359
Assignees
Labels
severity/major type/bug The issue is confirmed as a bug.

Comments

@qw4990
Copy link
Contributor

qw4990 commented May 25, 2020

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);
select count(*) from t;  // 62 rows
select /*+ MAX_EXECUTION_TIME(61000) */ sleep(1) from t;

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

The query should be killed since the max execution time is 61s but it would cost 62s.

3. What did you see instead (Required)

The query is processed successfully.

mysql> select /*+ MAX_EXECUTION_TIME(61000) */ sleep(1) from t;
+----------+
| sleep(1) |
+----------+
|        0 |
...
|        0 |
+----------+
62 rows in set (1 min 2.09 sec)

4. Affected version (Required)

v3.0.0/v4.0.0

5. Root Cause Analyze

The root cause is that if a query is marked as an expensive query, we would skip checking its max-execution-time in the loop.
image

@qw4990
Copy link
Contributor Author

qw4990 commented Jun 1, 2020

Fixed by #17359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment