Bug #83293 Logging is missing for interrupted queries
Submitted: 6 Oct 2016 22:22 Modified: 18 Oct 2016 22:51
Reporter: monty solomon Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S2 (Serious)
Version:5.7.13, 5.7.15 OS:Any
Assigned to: CPU Architecture:Any

[6 Oct 2016 22:22] monty solomon
Description:
Information about interrupted queries is not logged to the general or error logs.

ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded

How to repeat:
use mysql; select now(); select /*+ MAX_EXECUTION_TIME(1) */ * from help_topic; select now();

get error message

ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded

Check log files

Suggested fix:
Add logging for interrupted queries
[10 Oct 2016 20:30] MySQL Verification Team
Thank you for the bug report. According the Manual the start/shutdown process and 'critical' errors (i.e: a crash or corrupt table error) are logged and interrupted queries aren't assumed critical:

http://dev.mysql.com/doc/refman/5.7/en/error-log.html

"The error log contains information indicating when mysqld was started and stopped and also any critical errors that occur while the server is running. If mysqld notices a table that needs to be automatically checked or repaired, it writes a message to the error log."
[11 Oct 2016 4:05] monty solomon
Non-critical errors are recorded in the error log based on the value of  log_error_verbosity or log-warnings.

It would be useful to know which statements are being interrupted. Are the interrupted statements logged anywhere?

If the statement was running longer than the value of long_query_time before it is killed does it get logged to the slow log?
[18 Oct 2016 22:51] MySQL Verification Team
Thank you for the feedback. I was not able to find in the Manual any comment about so let us development to decide if documentation or server bug.