| 1 |
CREATE TABLE t1 (i int unique) ENGINE=innodb; |
| 2 |
reset master; |
| 3 |
begin; |
| 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 't1.i' |
| 8 |
commit; |
| 9 |
*** Results of the test: the binlog must have only Write_rows events not any Update_rows *** |
| 10 |
include/show_binlog_events.inc |
| 11 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 12 |
binlog.000001 # Query # # BEGIN |
| 13 |
binlog.000001 # Table_map # # table_id: # (test.t1) |
| 14 |
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F |
| 15 |
binlog.000001 # Xid # # COMMIT /* XID */ |
| 16 |
delete from t1; |
| 17 |
reset master; |
| 18 |
begin; |
| 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 't1.i' |
| 23 |
commit; |
| 24 |
*** Results of the test: the binlog must have only one Write_rows event not two *** |
| 25 |
include/show_binlog_events.inc |
| 26 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 27 |
binlog.000001 # Query # # BEGIN |
| 28 |
binlog.000001 # Table_map # # table_id: # (test.t1) |
| 29 |
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F |
| 30 |
binlog.000001 # Xid # # COMMIT /* XID */ |
| 31 |
drop table t1; |
| 32 |
RESET MASTER; |
| 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; |
| 36 |
TRUNCATE TABLE t2; |
| 37 |
DROP TABLE t1; |
| 38 |
############################################### |
| 39 |
### assertion: No event for 'TRUNCATE TABLE t2' |
| 40 |
############################################### |
| 41 |
include/show_binlog_events.inc |
| 42 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 43 |
binlog.000001 # Query # # use `test`; CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB |
| 44 |
binlog.000001 # Query # # BEGIN |
| 45 |
binlog.000001 # Table_map # # table_id: # (test.t1) |
| 46 |
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F |
| 47 |
binlog.000001 # Xid # # COMMIT /* XID */ |
| 48 |
binlog.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ |
| 49 |
############################################### |
| 50 |
RESET MASTER; |
| 51 |
CREATE TEMPORARY TABLE t1 (c1 int) Engine=InnoDB; |
| 52 |
INSERT INTO t1 VALUES (1), (2), (3); |
| 53 |
TRUNCATE t1; |
| 54 |
DROP TEMPORARY TABLE t1; |
| 55 |
############################################### |
| 56 |
### assertion: No event for 'TRUNCATE TABLE t1' |
| 57 |
############################################### |
| 58 |
include/show_binlog_events.inc |
| 59 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 60 |
############################################### |