Bug #33360 rpl_ndb_idempotent fails due to null field for table on slave side
Submitted: 19 Dec 2007 8:25 Modified: 2 Oct 2009 12:20
Reporter: Mats Kindahl Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Replication Severity:S2 (Serious)
Version:mysql-6.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: 6.0.5-bk

[19 Dec 2007 8:25] Mats Kindahl
Description:
The test case fails with a segmentation fault on the slave side. The failing code is:

    CREATE TABLE t1 (c1 CHAR(15) NOT NULL, c2 CHAR(15) NOT NULL, c3 INT NOT NULL, PRIMARY KEY (c3)) ENGINE = NDB ;
    INSERT INTO t1 VALUES ("row1","remove on slave",1);
    DELETE FROM t1;
    BEGIN;
    UPDATE t1 SET c2="does not exist" WHERE c3=1;
    INSERT INTO t1 VALUES ("row2","new on slave",2);
    COMMIT;

and the result of some data from gdb is:

    (gdb) p table->s->fields
    $50 = 3
    (gdb) p table->field[0]
    $51 = (class Field *) 0x0
    (gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7f5d3d7 in ?? () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x00000008 in ?? ()
#3  0x084b998d in write_core (sig=11) at stacktrace.c:240
#4  0x0830a3a8 in handle_segfault (sig=11) at mysqld.cc:2313
#5  <signal handler called>
#6  0xb7cfbe77 in __getdents () from /lib/tls/i686/cmov/libc.so.6
#7  0x0840d36d in unpack_row (rli=0x8e47a68, table=0x8e12940, colcnt=3, 
    row_data=0x8e8f5ae " on slave\002", cols=0x8e9da5c, row_end=0x8e9dac0, 
    master_reclength=0x8e9da88) at rpl_record.cc:261
#8  0x0840c759 in Rows_log_event::unpack_current_row (this=0x8e9da28, rli=0x8e47a68, 
    cols=0x8e9da5c) at log_event.h:3101
#9  0x083f9ae5 in Rows_log_event::write_row (this=0x8e9da28, rli=0x8e47a68, overwrite=true)
    at log_event.cc:7463
#10 0x083fa754 in Write_rows_log_event::do_exec_row (this=0x8e9da28, rli=0x8e47a68)
    at log_event.cc:7641
#11 0x083fe613 in Rows_log_event::do_apply_event (this=0x8e9da28, rli=0x8e47a68)
    at log_event.cc:6415
#12 0x084a8feb in Log_event::apply_event (this=0x8e9da28, rli=0x8e47a68) at log_event.h:951
#13 0x084a15c9 in exec_relay_log_event (thd=0x8e93df8, rli=0x8e47a68) at slave.cc:1634
#14 0x084a22d8 in handle_slave_sql (arg=0x8e467d0) at slave.cc:2317

How to repeat:
Run rpl_ndb_idempotent with the patch for BUG#33055 applied.

Note that the SQL fragment give above does not alone trigger the segmentation fault, the entire test case has to be executed.

Suggested fix:
Make the test case pass.