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

Fix QPO timeout overflow #2761

Merged
merged 1 commit into from
May 11, 2020
Merged

Fix QPO timeout overflow #2761

merged 1 commit into from
May 11, 2020

Conversation

alpes214
Copy link
Contributor

@alpes214 alpes214 commented May 8, 2020

Description:
Fixes integer overflow for query rules timeout

Verification:

  1. Set query rules with timeout value equals to one hour.
INSERT INTO mysql_query_rules (rule_id,active,match_digest,destination_hostgroup,timeout,apply) VALUES (1,1,'^SELECT.*FOR UPDATE$',0,3600*1000,1), (2,1,'^SELECT',1,3600*1000,1);
load mysql query rules to runtime; save mysql query rules to disk;
  1. Execute query
$ time mysql -uroot -proot -h127.0.0.1 -P6033 -e "select 1, sleep(3601)"
mysql: [Warning] Using a password on the command line interface can be insecure.
+---+-------------+
| 1 | sleep(3601) |
+---+-------------+
| 1 |           1 |
+---+-------------+

real    60m0.013s
user    0m0.012s
sys     0m0.000s

The query ended as expected after 1 hour.

@alpes214 alpes214 changed the title WIP Fix QPO timeout overflow Fix QPO timeout overflow May 8, 2020
@alpes214 alpes214 changed the title Fix QPO timeout overflow WIP Fix QPO timeout overflow May 8, 2020
@alpes214 alpes214 changed the title WIP Fix QPO timeout overflow Fix QPO timeout overflow May 8, 2020
@renecannao renecannao merged commit e668cc8 into v2.0.12 May 11, 2020
@renecannao renecannao deleted the v2.0.12-kill-query branch June 15, 2020 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants