include/master-slave.inc [rpl_server_count=3]
[connection master]
CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
CREATE TABLE t2 (a int key) ENGINE = NDB ;
reset master;
SHOW TABLES;
Tables_in_test
t1
t2
INSERT INTO t1 VALUES ("row1","will go away",1);
SELECT * FROM t1 ORDER BY c3;
c1	c2	c3
row1	will go away	1
SELECT * FROM t1 ORDER BY c3;
c1	c2	c3
row1	will go away	1
SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
@the_epoch:=MAX(epoch)
<the_epoch>
SELECT * FROM t1 ORDER BY c3;
c1	c2	c3
row1	will go away	1
stop slave;
set SQL_LOG_BIN=0;
insert into t2 values (1);
show binlog events from <binlog_start>;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	3	#	BEGIN
master-bin.000001	#	Table_map	3	#	table_id: # (test.t1)
master-bin.000001	#	Table_map	3	#	table_id: # (mysql.ndb_apply_status)
master-bin.000001	#	Write_rows	3	#	table_id: #
master-bin.000001	#	Write_rows	3	#	table_id: # flags: STMT_END_F
master-bin.000001	#	Query	3	#	COMMIT
set SQL_LOG_BIN=1;
@the_pos:=Position	@the_file:=SUBSTRING_INDEX(REPLACE(FILE,'\\','/'), '/', -1)
107	master-bin.000001
include/rpl_change_topology.inc [new topology=3->2]
include/start_slave.inc
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
DELETE FROM t1 WHERE c3 = 1;
UPDATE t1 SET c2="should go away" WHERE c3 = 2;
UPDATE t1 SET c2="C" WHERE c3 = 3;
DELETE FROM t1 WHERE c3 = 2;
SELECT * FROM t1 ORDER BY c3;
c1	c2	c3
row3	C	3
row4	D	4
INSERT INTO t1 VALUES ("row5","E",5);
SELECT * FROM t1 ORDER BY c3;
c1	c2	c3
row3	C	3
row4	D	4
row5	E	5
SELECT * FROM t1 ORDER BY c3;
c1	c2	c3
row3	C	3
row4	D	4
row5	E	5
==== clean up ====
DROP TABLE t1;
DROP TABLE t2;
include/rpl_end.inc
