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;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
SET SESSION BINLOG_FORMAT=STATEMENT;
SET GLOBAL  BINLOG_FORMAT=STATEMENT;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1;
a	b
1	1
2	2
**** On Slave ****
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1;
a	b
1	1
2	2
3	3
**** On Master ****
TRUNCATE TABLE t1;
SELECT * FROM t1;
a	b
**** On Slave ****
SELECT * FROM t1;
a	b
**** On Master ****
DROP TABLE t1;
show binlog events from <binlog_start>;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE IF EXISTS t1
master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Query	#	#	use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Query	#	#	use `test`; TRUNCATE TABLE t1
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t1
RESET MASTER;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
SET SESSION BINLOG_FORMAT=MIXED;
SET GLOBAL  BINLOG_FORMAT=MIXED;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1;
a	b
1	1
2	2
**** On Slave ****
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1;
a	b
1	1
2	2
3	3
**** On Master ****
TRUNCATE TABLE t1;
SELECT * FROM t1;
a	b
**** On Slave ****
SELECT * FROM t1;
a	b
**** On Master ****
DROP TABLE t1;
show binlog events from <binlog_start>;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE IF EXISTS t1
master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Query	#	#	use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Query	#	#	use `test`; TRUNCATE TABLE t1
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t1
RESET MASTER;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
SET SESSION BINLOG_FORMAT=ROW;
SET GLOBAL  BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1;
a	b
1	1
2	2
**** On Slave ****
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1;
a	b
1	1
2	2
3	3
**** On Master ****
TRUNCATE TABLE t1;
SELECT * FROM t1;
a	b
**** On Slave ****
SELECT * FROM t1;
a	b
**** On Master ****
DROP TABLE t1;
show binlog events from <binlog_start>;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE IF EXISTS t1
master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Query	#	#	use `test`; TRUNCATE TABLE t1
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t1
RESET MASTER;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
SET SESSION BINLOG_FORMAT=STATEMENT;
SET GLOBAL  BINLOG_FORMAT=STATEMENT;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1;
a	b
1	1
2	2
**** On Slave ****
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1;
a	b
1	1
2	2
3	3
**** On Master ****
DELETE FROM t1;
SELECT * FROM t1;
a	b
**** On Slave ****
SELECT * FROM t1;
a	b
**** On Master ****
DROP TABLE t1;
show binlog events from <binlog_start>;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE IF EXISTS t1
master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Query	#	#	use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Query	#	#	use `test`; DELETE FROM t1
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t1
RESET MASTER;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
SET SESSION BINLOG_FORMAT=MIXED;
SET GLOBAL  BINLOG_FORMAT=MIXED;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1;
a	b
1	1
2	2
**** On Slave ****
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1;
a	b
1	1
2	2
3	3
**** On Master ****
DELETE FROM t1;
SELECT * FROM t1;
a	b
**** On Slave ****
SELECT * FROM t1;
a	b
**** On Master ****
DROP TABLE t1;
show binlog events from <binlog_start>;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE IF EXISTS t1
master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Query	#	#	use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Query	#	#	use `test`; DELETE FROM t1
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t1
RESET MASTER;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
SET SESSION BINLOG_FORMAT=ROW;
SET GLOBAL  BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1;
a	b
1	1
2	2
**** On Slave ****
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1;
a	b
1	1
2	2
3	3
**** On Master ****
DELETE FROM t1;
SELECT * FROM t1;
a	b
**** On Slave ****
SELECT * FROM t1;
a	b
3	3
**** On Master ****
DROP TABLE t1;
show binlog events from <binlog_start>;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE IF EXISTS t1
master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; BEGIN
master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
master-bin.000001	#	Delete_rows	#	#	table_id: # flags: STMT_END_F
master-bin.000001	#	Xid	#	#	COMMIT /* XID */
master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t1
RESET MASTER;