Port max_statement_time from the Twitter branch

Registered by Vadim Tkachenko

Port the statement timeout feature from the Twitter branch: https://github.com/twitter/mysql/wiki/Statement-Timeout

Blueprint information

Status:
Complete
Approver:
Alexey Kopytov
Priority:
Medium
Drafter:
Alexey Kopytov
Direction:
Approved
Assignee:
Vlad Lesin
Definition:
Approved
Series goal:
Accepted for 5.6
Implementation:
Implemented
Milestone target:
milestone icon 5.6.13-61.0
Started by
Vlad Lesin
Completed by
Alexey Kopytov

Whiteboard

The differences between twitter implementation and our port:

1) we does not implement per-select option. We decided to port "per-query-variables-settings" instead as more common solution;

2) the error code for interrupted query is changed as twitter error code has already used for another purpose in 5.6.

3) the MAX_STATEMENT_TIME user resource limit has not been ported from the Twitter implementation

Here are some things that were not described in twitter wiki:

1) have_statement_timeout system variable shows if the feature is supported for the current operating system;

2) status variables:

a) Max_statement_time_exceeded - the number statements that exceeded execution time limit;

b) Max_statement_time_set - the number of statements for which execution time limit was set;

c) Max_statement_time_set_failed - the number of statements for which execution time limit could not be set, that can happen if some OS-related limits were exceeded;

3) if PS is replaced with MySQL "mysql_fix_privilege_tables.sql" script should be executed to recreate mysql.user table, if MySQL is replaced with PS "mysql_system_tables_fix.sql" should be executed to update mysql.user table.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.