-- source include/have_multi_ndb.inc -- source include/have_binlog_format_mixed_or_row.inc -- source include/have_debug.inc # # Test behaviour of Ndb Binlogging with asynchronous # NdbAPI disconnections # # Blobs are relevant as they internally use multiple # separate events which must be merged in the API # to generate single logical row events. # # If the event stream is not consistent around the # disconnection and reconnection then the Blob # merge/reassmebly code is likely to detect a # problem. # # Multiple blob columns are used to increase the # chance of detecting a problem # --connection server1 --echo Create table with multiple Blob columns create table t1 (a int primary key, b0 text, b1 text, b2 text, b3 text, b4 text, b5 text, b6 text, b7 text, b8 text, b9 text) engine=ndb comment='NDB_TABLE=NOLOGGING=1'; --let $rows=20 --let $i=$rows --disable_query_log while ($i) { --eval insert into t1 values ($i, repeat('BJC0', 1000), repeat('TSG1', 1000), repeat('EIN2', 1000), repeat('GIM3', 500), repeat('GOC4', 600), repeat('TFL5', 713), repeat('PRH6', 300), repeat('HFB7', 555), repeat('SHC8', 313), repeat('GHC9', 453)) --dec $i } --enable_query_log delimiter %; CREATE DEFINER=`root`@`localhost` PROCEDURE `load1`() begin set @x=1; repeat update test.t1 set b0=repeat('SMT0', 1000), b1=repeat('BML1', 1000), b2=repeat('TMS2', 1000), b3=repeat('LMN3', 500), b4=repeat('LME4', 600), b5=repeat('SMN5', 713), b6=repeat('LMB6', 300), b7=repeat('SMC7', 555), b8=repeat('SML8', 313), b9=repeat('TMS9', 453); set @x=row_count(); until @x = 0 end repeat; end% delimiter ;% --echo Starting Blob load on server 1 --send call load1() --connection server2 --echo Cause cluster disconnections of server2 call mtr.add_suppression("incident event has been written to the binary log"); --let $loops=6 while ($loops) { --echo Disconnecting server 2 --exec $NDB_MGM -e"ALL DUMP 900 16" --sleep 15 --dec $loops } # Wait for recovery --source include/ndb_not_readonly.inc --echo Loops done --echo Clear table --let $remain=1 # Delete the rows from the table, so the stored procedure knows # to exit --disable_query_log --disable_result_log while($remain) { --error 0, 1205 delete from test.t1; --let $remain = query_get_value(select count(1) as c from test.t1, c, 1) } --enable_result_log --enable_query_log --echo Returing to server1 --connection server1 # May get lock timeout (deadlock) from stored proc # deadlocking with delete - that's ok --error 0, 1205 --reap drop procedure load1; drop table t1;