Bug #17801 INSERT ON DUPLICATE KEY UPDATE using NDB table cause core
Submitted: 28 Feb 2006 18:26 Modified: 13 Mar 2006 12:51
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version:5.1.8 OS:Linux (Linux 32 Bit OS)
Assigned to: Martin Skold CPU Architecture:Any

[28 Feb 2006 18:26] Jonathan Miller
Description:
drop table if exists t1;
CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B));
INSERT t1 VALUES (1,2,10), (3,4,20);
INSERT t1 VALUES (5,6,30) ON DUPLICATE KEY UPDATE c=c+100;
SELECT * FROM t1;
INSERT t1 VALUES (5,7,40) ON DUPLICATE KEY UPDATE c=c+100;
SELECT * FROM t1;
INSERT t1 VALUES (8,4,50) ON DUPLICATE KEY UPDATE c=c+1000;
SELECT * FROM t1;
INSERT t1 VALUES (1,4,60) ON DUPLICATE KEY UPDATE c=c+10000;
SELECT * FROM t1;
drop table t1;

#0  0x0016b402 in __kernel_vsyscall ()
#1  0x00a2855f in pthread_kill () from /lib/libpthread.so.0
#2  0x082f2e5b in write_core (sig=12683) at stacktrace.c:220
#3  0x081d3762 in handle_segfault (sig=11) at mysqld.cc:2179
#4  <signal handler called>
#5  key_copy (to_key=0x7db690 "x[�\t\017", from_record=0x9b46098 "�\005", key_info=0x9b46de8,
    key_length=16777216) at key.cc:103
#6  0x0824cdc4 in write_record (thd=0x9b02580, table=0x9b385b8, info=0x7db7e0)
    at sql_insert.cc:999
#7  0x08251643 in mysql_insert (thd=0x9b02580, table_list=0x9b35290, fields=@0x9b02a4c,
    values_list=@0x9b02a70, update_fields=@0x9b02a64, update_values=@0x9b02a58,
    duplic=DUP_UPDATE, ignore=false) at sql_insert.cc:514
#8  0x081eec4c in mysql_execute_command (thd=0x9b02580) at sql_parse.cc:3291
#9  0x081f74f4 in mysql_parse (thd=0x9b02580,
    inBuf=0x9b351f0 "INSERT t1 VALUES (5,7,40) ON DUPLICATE KEY UPDATE c=c+100", length=57)
    at sql_parse.cc:5775
#10 0x081f7abd in dispatch_command (command=COM_QUERY, thd=0x9b02580, packet=Variable "packet" is not available.
)
    at sql_parse.cc:1769
#11 0x081f9847 in handle_one_connection (arg=0x9b02580) 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:
Create ndb_1.test and insert SQL from above.

./mysql-test-run --force --mysqld=--default-storage-engine=ndb --with-ndbcluster-all --ndb-extra-test --do-test=ndb_1
[13 Mar 2006 12:51] Jonathan Miller
I can not reproduce with latest pull.
JBM