Bug #72243 Queries where execution time exceeds 'MAX_STATEMENT_TIME' should go to slow log
Submitted: 4 Apr 2014 18:48 Modified: 4 Apr 2014 19:32
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:5.7.4 OS:Any
Assigned to: CPU Architecture:Any

[4 Apr 2014 18:48] Peter Laursen
Queries where execution time exceeds 'MAX_STATEMENT_TIME' (introduced in 5.7.4 as both a server variable and a query-clause for SELECT queries) should be logged to slow query log (always  - or optionally controlled by a server variable similar to the option to log queries not using indexes).

(I am aware that unlike normal slow queries (including queries not using indexes), queries that are aborted due to 'MAX_STATEMENT_TIME' beeing exceeded are not returning a result set - on the opposite they are killed before they have finished.  This could further leed to extension of the log format (for both log files and log tables) distinguishing queries that are considered slow for this particular reason as compared to other reasons)

How to repeat:
see above

Suggested fix:
see above
[4 Apr 2014 19:19] Sveta Smirnova
Thank you for the report.

Why can't you just use option long_query_time={Value of MAX_STATEMENT_TIME}?
[4 Apr 2014 19:27] Peter Laursen
@Sveta.  Because I may use a different MAX_STATEMENT_TIME -clause for different SELECT queries (1 second for one query, 100 seconds for another etc.).
[4 Apr 2014 19:32] Sveta Smirnova
Thank you for the feedback.

Verified as feature request: "please implement option, saying to write all queries, interrupted because option MAX_STATEMENT_TIME, to slow query log"