Bug #59314 CREATE TEMPORARY TABLE ... LIKE ... on an NDB table crashes the mysqld node.
Submitted: 5 Jan 2011 18:30 Modified: 1 Feb 2011 9:51
Reporter: Daniel Smythe Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:7.1.9-spj OS:Any
Assigned to: CPU Architecture:Any
Tags: crash, like, mysqld, ndb, temporary table

[5 Jan 2011 18:30] Daniel Smythe
Description:
CREATE TEMPORARY TABLE ... LIKE ... on an NDB table crashes the mysqld node.

How to repeat:
1. Setup simple 7.1.9-spj cluster

mysql> use test;
Database changed

mysql> show tables;
Empty set (0.04 sec)

mysql> CREATE TABLE simple ( a int ) ENGINE=ndb;
Query OK, 0 rows affected (0.43 sec)

mysql> CREATE TEMPORARY TABLE temp LIKE simple;
ERROR 2013 (HY000): Lost connection to MySQL server during query

--- mysqld log ---

110105 11:16:05 [Note] NDB Binlog: CREATE TABLE Event: REPL$test/simple
110105 11:16:05 [Note] NDB Binlog: logging ./test/simple (UPDATED,USE_WRITE)
110105 11:16:20 [ERROR] NDB: programming error, no lock taken while running query CREATE TEMPORARY TABLE temp LIKE simple. Message: ha_ndbcluster::create
110105 11:16:20 - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=16384
read_buffer_size=262144
max_used_connections=1
max_threads=151
threads_connected=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 49900 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x2d57650
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x7f8b3005de78 thread_stack 0x20000
/home/dsmythe/binaries/mysql-cluster-spj-7.1.9/libexec/mysqld(my_print_stacktrace+0x33)[0x97ce33]
/home/dsmythe/binaries/mysql-cluster-spj-7.1.9/libexec/mysqld(handle_segfault+0x3db)[0x61a77b]
/lib64/libpthread.so.0[0x3a55c0f440]
/lib64/libc.so.6(gsignal+0x35)[0x3a558329a5]
/lib64/libc.so.6(abort+0x175)[0x3a55834185]
/home/dsmythe/binaries/mysql-cluster-spj-7.1.9/libexec/mysqld[0x7c2770]
/home/dsmythe/binaries/mysql-cluster-spj-7.1.9/libexec/mysqld(_ZN13ha_ndbcluster6createEPKcP8st_tableP24st_ha_create_information+0x3cf)[0x7b2d1f]
/home/dsmythe/binaries/mysql-cluster-spj-7.1.9/libexec/mysqld(_Z15ha_create_tableP3THDPKcS2_S2_P24st_ha_create_informationb+0x13a)[0x708cfa]
/home/dsmythe/binaries/mysql-cluster-spj-7.1.9/libexec/mysqld(_Z23mysql_create_like_tableP3THDP10TABLE_LISTS2_P24st_ha_create_information+0x406)[0x71bfb6]
/home/dsmythe/binaries/mysql-cluster-spj-7.1.9/libexec/mysqld(_Z21mysql_execute_commandP3THD+0x4bb3)[0x6304b3]
/home/dsmythe/binaries/mysql-cluster-spj-7.1.9/libexec/mysqld(_Z11mysql_parseP3THDPcjPPKc+0x3e2)[0x631132]
/home/dsmythe/binaries/mysql-cluster-spj-7.1.9/libexec/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x545)[0x631695]
/home/dsmythe/binaries/mysql-cluster-spj-7.1.9/libexec/mysqld(_Z10do_commandP3THD+0xe8)[0x6329f8]
/home/dsmythe/binaries/mysql-cluster-spj-7.1.9/libexec/mysqld(handle_one_connection+0x21d)[0x624e4d]
/lib64/libpthread.so.0[0x3a55c07761]

/lib64/libc.so.6(clone+0x6d)[0x3a558e14fd]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x7f8b2482a530 is an invalid pointer
thd->thread_id=2
thd->killed=NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
110105 11:16:21 mysqld_safe Number of processes running now: 0
110105 11:16:21 mysqld_safe mysqld restarted

Suggested fix:
Attempting to create a temporary table just like it results in an error handled nicely. Perhaps the same.

mysql> CREATE TEMPORARY TABLE temp ( a int ) ENGINE=ndb;
ERROR 1478 (HY000): Table storage engine 'ndbcluster' does not support the create option 'TEMPORARY'
[6 Jan 2011 4:57] MySQL Verification Team
seen bug #52516 ?
[1 Feb 2011 9:51] Martin Skold
Duplicate of Bug#57437