Bug #17961 Crash if kill (select)
Submitted: 6 Mar 2006 12:39 Modified: 29 Apr 2006 13:36
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.20-BK, 4.1-BK, 5.1.8-beta-debug OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[6 Mar 2006 12:39] Peter Gulutzan
Description:
I say KILL (SELECT column-name FROM table-name).
Crash.

How to repeat:
mysql> create table tkill (s1 int);
Query OK, 0 rows affected (0.01 sec)

mysql> kill (select s1 from tkill);
ERROR 2013 (HY000): Lost connection to MySQL server during query
[6 Mar 2006 12:55] Valeriy Kravchuk
Thank you for a bug report. Verified just as described on 5.0.20-BK (ChangeSet@1.2056.1.2, 2006-03-05 01:11:24+03:00) on Linux:

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.0.20    |
+-----------+
1 row in set (0.00 sec)

mysql> create table tkill (s1 int);
Query OK, 0 rows affected (0.01 sec)

mysql> kill (select s1 from tkill);
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
Number of processes running now: 0
060310 09:44:04  mysqld restarted

There is a stack trace, but as this bug is present in all current versions, it will be easy for anybody to get it and resolve.
[27 Mar 2006 14:37] Konstantin Osipov
Brian, please reassing. The bug is in query execution, and it's very similar to Bug#14851
[27 Mar 2006 14:38] Konstantin Osipov
Sorry, my original analysis was wrong.
[27 Mar 2006 14:44] Andrey Hristov
I think this was already fixed by Serg. Valeriy, could you try to reproduce it again?
[27 Mar 2006 14:50] Konstantin Osipov
Andrey,
I believe the solution is to disable subqueries in KILL syntax.
Notice that this is 4.1
[29 Apr 2006 13:36] Valeriy Kravchuk
Now in 4.1-BK and 5.0_BK (5.0.22) we have:

mysql> kill (select s1 from tkill);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'select s1 from tkill)' at line 1

So, no crash. This syntax is not allowed now. Problem solved.