Bug #56914 KILL QUERY may not return ERROR 1317
Submitted: 22 Sep 2010 1:26 Modified: 22 Sep 2010 11:41
Reporter: Sadao Hiratsuka (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.1.50 OS:Any
Assigned to: CPU Architecture:Any
Tags: KILL QUERY, qc

[22 Sep 2010 1:26] Sadao Hiratsuka
Description:
KILL QUERY may not return ERROR 1317 by its timing.

How to repeat:
mysql> create table test (id int primary key);
mysql> insert into test values (1), (2);

- CASE 1 : KILL QUERY 0-1 second later

mysql> select sleep(1) from test;
Ctrl-C -- sending "KILL QUERY 2" to server ...
Ctrl-C -- query aborted.
ERROR 1317 (70100): Query execution was interrupted

mysql>

- CASE 2 : KILL QUERY 1-2 seconds later

mysql> select sleep(1) from test;
Ctrl-C -- sending "KILL QUERY 2" to server ...
Ctrl-C -- query aborted.
+----------+
| sleep(1) |
+----------+
+----------+
2 rows in set (1.51 sec)

mysql>

Suggested fix:
I think the CASE 2 also should return ERROR 1317,
and should not return '2 rows in set'.
[22 Sep 2010 5:49] Valeriy Kravchuk
May be related to bug #45679.
[22 Sep 2010 11:41] Sveta Smirnova
Thank you for the report.

I think this is just timing issue: in second time when kill was send mysqld really finished query execution and started to send results. This is why you didn't get server error message. So this is either not a bug or duplicate of bug which Valeriy mentioned.