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 */