Bug #32945 killing create table .. like .. causes a server to crash
Submitted: 3 Dec 2007 19:53 Modified: 4 Dec 2007 11:35
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: DDL Severity:S1 (Critical)
Version:5.0.52 OS:Any
Assigned to: CPU Architecture:Any
Tags: KILL

[3 Dec 2007 19:53] Shane Bester
Description:
if you kill a "create table t2 like t1" while it waits for t1 to become unlocked, the server will crash with this stack trace:

mysqld-debug.exe!table_cache_key
mysqld-debug.exe!hash_key
mysqld-debug.exe!rec_hashnr
mysqld-debug.exe!hash_delete
mysqld-debug.exe!unlock_table_name
mysqld-debug.exe!mysql_create_like_table
mysqld-debug.exe!mysql_execute_command
mysqld-debug.exe!mysql_parse
mysqld-debug.exe!dispatch_command
mysqld-debug.exe!do_command
mysqld-debug.exe!handle_one_connection
mysqld-debug.exe!pthread_start
mysqld-debug.exe!_threadstart

5.1.23 didn't appear to have the problem.

How to repeat:
Use a debug build of 5.0:  Perhaps release build will crash too, but not all the time.  Debug build crashed each time for me.

connection1
--------------
drop table if exists t1;
drop table if exists t2;
create table t1(id int)engine=myisam;
insert into t1 values (0);
lock table t1 write;

connection2
-----------
create table t2 like t1;  #will hang

connection1
--------------
show processlist;
kill <id of the connection2>

Suggested fix:
is this related to bug #30193 ?
[4 Dec 2007 11:35] Davi Arnaut
This is a duplicate of Bug#31479