Bug #52516 Server crashes with CREATE TEMPORARY TABLE.
Submitted: 1 Apr 2010 3:07 Modified: 1 Feb 2011 9:52
Reporter: Sajjad Tariq Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version:mysql-5.1-telco-7.0 OS:Linux
Assigned to: CPU Architecture:Any
Tags: 7.1, cluster_telco, mysql-5.1.41-ndb-7.0.13, mysql-5.1.41-ndb-7.0.13

[1 Apr 2010 3:07] Sajjad Tariq
Description:
Server crashes with CREATE TEMPORARY TABLE tmp_test LIKE test.test;

How to repeat:
Create a table with ndbcluster engine.

CREATE TABLE `test`.`test` ( `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Num` int(10) unsigned NOT NULL, `Text` varchar(10) NOT NULL, PRIMARY KEY (`ID`) )
 ENGINE=ndbcluster AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;

Run following create statement.

CREATE TEMPORARY TABLE tmp_test LIKE test.test;

Suggested fix:
As following create statement works.

CREATE TEMPORARY TABLE tmp_test (Select * from  test.test WHERE ID is null);

So, fix create temporary table statement with "LIKE".
[3 Apr 2010 12:17] Sveta Smirnova
Thank you for the report.

Verified as described:

#0  0x0000003429e0b002 in pthread_kill () from /lib64/libpthread.so.0
#0  0x0000003429e0b002 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000638976 in handle_segfault (sig=6) at mysqld.cc:2614
#2  <signal handler called>
#3  0x0000003429230015 in raise () from /lib64/libc.so.6
#4  0x0000003429231980 in abort () from /lib64/libc.so.6
#5  0x0000000000834263 in ndbcluster_no_global_schema_lock_abort (thd=0xb0f29c8, msg=0xbd20ae "ha_ndbcluster::create") at ha_ndbcluster_binlog.cc:752
#6  0x0000000000823565 in ha_ndbcluster::create (this=0xb0cc388, name=0x40cf0a60 "/users/ssmirnova/blade12/src/mysql-5.1-telco-7.1/mysql-test/var/tmp/mysqld.1.1/#sql6413_3_0", form=0x40cef390, 
    create_info=0x40cf1fd0) at ha_ndbcluster.cc:6912
#7  0x000000000074b145 in ha_create_table (thd=<value optimized out>, path=<value optimized out>, db=<value optimized out>, table_name=0xb0ef948 "tmp_test", create_info=<value optimized out>, 
    update_create_info=<value optimized out>) at handler.cc:3622
#8  0x0000000000769add in mysql_create_like_table (thd=0xb0f29c8, table=0xb0ef990, src_table=0xb0efd08, create_info=0x40cf1fd0) at sql_table.cc:5362
#9  0x0000000000651467 in mysql_execute_command (thd=0xb0f29c8) at sql_parse.cc:2739
#10 0x0000000000652147 in mysql_parse (thd=0xb0f29c8, inBuf=<value optimized out>, length=46, found_semicolon=0x40cf2f58) at sql_parse.cc:5977
#11 0x00000000006530fe in dispatch_command (command=COM_QUERY, thd=0xb0f29c8, packet=<value optimized out>, packet_length=<value optimized out>) at sql_parse.cc:1236
#12 0x0000000000653c88 in do_command (thd=0xb0f29c8) at sql_parse.cc:877
#13 0x00000000006434be in handle_one_connection (arg=<value optimized out>) at sql_connect.cc:1133
#14 0x0000003429e061b5 in start_thread () from /lib64/libpthread.so.0
#15 0x00000034292cd39d in clone () from /lib64/libc.so.6
#16 0x0000000000000000 in ?? ()
[1 Feb 2011 9:52] Martin Skold
Duplicate of Bug#57437