Bug #17210 Create temp table call to ha_ndbcluster::create_handler_files caused core
Submitted: 7 Feb 2006 22:35 Modified: 23 Feb 2006 10:37
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version:5.1.7 OS:Linux (Linux 32 Bit OS)
Assigned to: Tomas Ulin CPU Architecture:Any

[7 Feb 2006 22:35] Jonathan Miller
Description:
Seems like I already had one open on this, but could only find 16552 which is not a core.

create temporary table t3(f int);

Errors are (from /home/ndbdev/jmiller/clones/mysql-5.1-new/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 64: query 'create temporary table t3(f int)' failed: 2013: Lost connection to MySQL server during query
(the last lines may be the most important ones)

#0  0x006b6402 in __kernel_vsyscall ()
#1  0x00a2855f in pthread_kill () from /lib/libpthread.so.0
#2  0x082ee94b in write_core (sig=29178) at stacktrace.c:220
#3  0x081d19c2 in handle_segfault (sig=11) at mysqld.cc:2197
#4  <signal handler called>
#5  0x0833695d in ha_ndbcluster::create_handler_files (this=0x9a17ed0,
    file=0x8745b8 "/home/ndbdev/jmiller/clones/mysql-5.1-new/mysql-test/var/tmp/@0023sql71fa_7_0") at ha_ndbcluster.cc:356
#6  0x082854a2 in rea_create_table (thd=0x9a06bc0,
    path=0x8745b8 "/home/ndbdev/jmiller/clones/mysql-5.1-new/mysql-test/var/tmp/@0023sql71fa_7_0", db=0x99532f0 "test", table_name=0x9a17c98 "t3", create_info=0x9a07154, create_fields=@0x0,
    keys=0, key_info=0x0, file=0x9a17ed0) at unireg.cc:333
#7  0x082b4a03 in mysql_create_table (thd=0x9a06bc0, db=0x99532f0 "test",
    table_name=0x9a17c98 "t3", create_info=0x9a07154, fields=@0x9a07078, keys=@0x9a0706c,
    internal_tmp_table=false, select_field_count=0) at sql_table.cc:2246
#8  0x081f4aaa in mysql_execute_command (thd=0x9a06bc0) at sql_parse.cc:2902
#9  0x081f5054 in mysql_parse (thd=0x9a06bc0,
    inBuf=0x9a17c38 "create temporary table t3(f int)", length=32) at sql_parse.cc:5719
#10 0x081f561d in dispatch_command (command=COM_QUERY, thd=0x9a06bc0, packet=Variable "packet" is not available.
)
    at sql_parse.cc:1769
#11 0x081f73a7 in handle_one_connection (arg=0x9a06bc0) at sql_parse.cc:1536
#12 0x00a25b80 in start_thread () from /lib/libpthread.so.0
#13 0x0097d9ce in clone () from /lib/libc.so.6

How to repeat:
Complete test used to produce this, but I think the create is all that is needed.

create table t1(f int);
create table t2(f int);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
connection con1;
create temporary table t3(f int);
[17 Feb 2006 13:30] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/2783
[17 Feb 2006 15:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/2796
[17 Feb 2006 15:20] Jonathan Miller
For Docs guys:

case 1:
default-storage-engine=ndb
create temp table (); => a myisam tmp tble
case 2:
default-storage-engine=<other storage engine>
create temp table (); => a <other storage engine> tmp table
Always:
create temp table ... engine=ndb; => unsupported error
alter table t1 ... engine=ndb; => unsupported error if t1 is a temporary table
[17 Feb 2006 15:55] Tomas Ulin
pushed to 5.1.8

there are the same issues in 4.1 and 5.0 though, but can't see that this is so important, that we should fix it there as well
[20 Feb 2006 22:32] Tomas Ulin
changed to be included in 5.1.7
[23 Feb 2006 10:37] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented fix in 5.1.7 changelog. Closed.