1 CREATE TABLE t1 (i int unique) ENGINE=innodb;
4 insert into t1 values (1),(2);
5 *** the following UPDATE query wont generate any updates for the binlog ***
6 update t1 set i = 3 where i < 3;
7 ERROR 23000: Duplicate entry '3' for key 'i'
9 *** Results of the test: the binlog must have only Write_rows events not any Update_rows ***
10 show binlog events from <binlog_start>;
11 Log_name Pos Event_type Server_id End_log_pos Info
12 master-bin.000001 # Query # # BEGIN
13 master-bin.000001 # Table_map # # table_id: # (test.t1)
14 master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
15 master-bin.000001 # Xid # # COMMIT /* XID */
19 insert into t1 values (1),(2);
20 *** the following UPDATE query wont generate any updates for the binlog ***
21 insert into t1 values (3),(4),(1),(2);
22 ERROR 23000: Duplicate entry '1' for key 'i'
24 *** Results of the test: the binlog must have only one Write_rows event not two ***
25 show binlog events from <binlog_start>;
26 Log_name Pos Event_type Server_id End_log_pos Info
27 master-bin.000001 # Query # # BEGIN
28 master-bin.000001 # Table_map # # table_id: # (test.t1)
29 master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
30 master-bin.000001 # Xid # # COMMIT /* XID */
33 CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB;
34 INSERT INTO t1 VALUES (1), (2), (3);
35 CREATE TEMPORARY TABLE IF NOT EXISTS t2 LIKE t1;
38 ###############################################
39 ### assertion: No event for 'TRUNCATE TABLE t2'
40 ###############################################
41 show binlog events from <binlog_start>;
42 Log_name Pos Event_type Server_id End_log_pos Info
43 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB
44 master-bin.000001 # Query # # BEGIN
45 master-bin.000001 # Table_map # # table_id: # (test.t1)
46 master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
47 master-bin.000001 # Xid # # COMMIT /* XID */
48 master-bin.000001 # Query # # use `test`; DROP TABLE t1
49 ###############################################
51 CREATE TEMPORARY TABLE t1 (c1 int) Engine=InnoDB;
52 INSERT INTO t1 VALUES (1), (2), (3);
54 DROP TEMPORARY TABLE t1;
55 ###############################################
56 ### assertion: No event for 'TRUNCATE TABLE t1'
57 ###############################################
58 show binlog events from <binlog_start>;
59 Log_name Pos Event_type Server_id End_log_pos Info
60 ###############################################