stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
**** On Master ****
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1 ORDER BY a,b;
a	b
1	1
2	2
**** On Slave ****
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1 ORDER BY a,b;
a	b
1	1
2	2
3	3
**** On Master ****
TRUNCATE TABLE t1;
SELECT * FROM t1 ORDER BY a,b;
a	b
**** On Slave ****
SELECT * FROM t1 ORDER BY a,b;
a	b
**** On Master ****
DROP TABLE t1;
SHOW BINLOG EVENTS;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	4	Format_desc	1	102	Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001	102	Query	1	219	use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001	219	Query	1	283	BEGIN
master-bin.000001	283	Table_map	1	40	table_id: # (test.t1)
master-bin.000001	323	Table_map	1	95	table_id: # (mysql.ndb_apply_status)
master-bin.000001	378	Write_rows	1	137	table_id: #
master-bin.000001	420	Write_rows	1	184	table_id: # flags: STMT_END_F
master-bin.000001	467	Query	1	532	COMMIT
master-bin.000001	532	Query	1	612	use `test`; TRUNCATE TABLE t1
master-bin.000001	612	Query	1	688	use `test`; DROP TABLE t1
**** On Master ****
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1 ORDER BY a,b;
a	b
1	1
2	2
**** On Slave ****
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1 ORDER BY a,b;
a	b
1	1
2	2
3	3
**** On Master ****
DELETE FROM t1;
SELECT * FROM t1 ORDER BY a,b;
a	b
**** On Slave ****
SELECT * FROM t1 ORDER BY a,b;
a	b
3	3
**** On Master ****
DROP TABLE t1;
SHOW BINLOG EVENTS;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	4	Format_desc	1	102	Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001	102	Query	1	219	use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001	219	Query	1	283	BEGIN
master-bin.000001	283	Table_map	1	40	table_id: # (test.t1)
master-bin.000001	323	Table_map	1	95	table_id: # (mysql.ndb_apply_status)
master-bin.000001	378	Write_rows	1	137	table_id: #
master-bin.000001	420	Write_rows	1	184	table_id: # flags: STMT_END_F
master-bin.000001	467	Query	1	532	COMMIT
master-bin.000001	532	Query	1	612	use `test`; TRUNCATE TABLE t1
master-bin.000001	612	Query	1	688	use `test`; DROP TABLE t1
master-bin.000001	688	Query	1	805	use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001	805	Query	1	869	BEGIN
master-bin.000001	869	Table_map	1	40	table_id: # (test.t1)
master-bin.000001	909	Table_map	1	95	table_id: # (mysql.ndb_apply_status)
master-bin.000001	964	Write_rows	1	137	table_id: #
master-bin.000001	1006	Write_rows	1	184	table_id: # flags: STMT_END_F
master-bin.000001	1053	Query	1	1118	COMMIT
master-bin.000001	1118	Query	1	1182	BEGIN
master-bin.000001	1182	Table_map	1	40	table_id: # (test.t1)
master-bin.000001	1222	Table_map	1	95	table_id: # (mysql.ndb_apply_status)
master-bin.000001	1277	Write_rows	1	137	table_id: #
master-bin.000001	1319	Delete_rows	1	176	table_id: # flags: STMT_END_F
master-bin.000001	1358	Query	1	1423	COMMIT
master-bin.000001	1423	Query	1	1499	use `test`; DROP TABLE t1
