| 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 '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 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 13 |
master-bin.000001 # Annotate_rows # # insert into t1 values (1),(2) |
| 14 |
master-bin.000001 # Table_map # # table_id: # (test.t1) |
| 15 |
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
| 16 |
master-bin.000001 # Xid # # COMMIT /* XID */ |
| 17 |
delete from t1; |
| 18 |
reset master; |
| 19 |
begin; |
| 20 |
insert into t1 values (1),(2); |
| 21 |
*** the following UPDATE query wont generate any updates for the binlog *** |
| 22 |
insert into t1 values (3),(4),(1),(2); |
| 23 |
ERROR 23000: Duplicate entry '1' for key 'i' |
| 24 |
commit; |
| 25 |
*** Results of the test: the binlog must have only one Write_rows event not two *** |
| 26 |
include/show_binlog_events.inc |
| 27 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 28 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 29 |
master-bin.000001 # Annotate_rows # # insert into t1 values (1),(2) |
| 30 |
master-bin.000001 # Table_map # # table_id: # (test.t1) |
| 31 |
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
| 32 |
master-bin.000001 # Xid # # COMMIT /* XID */ |
| 33 |
drop table t1; |
| 34 |
RESET MASTER; |
| 35 |
CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB; |
| 36 |
INSERT INTO t1 VALUES (1), (2), (3); |
| 37 |
CREATE TEMPORARY TABLE IF NOT EXISTS t2 LIKE t1; |
| 38 |
TRUNCATE TABLE t2; |
| 39 |
DROP TABLE t1; |
| 40 |
############################################### |
| 41 |
### assertion: No event for 'TRUNCATE TABLE t2' |
| 42 |
############################################### |
| 43 |
include/show_binlog_events.inc |
| 44 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 45 |
master-bin.000001 # Gtid # # GTID #-#-# |
| 46 |
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB |
| 47 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 48 |
master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1), (2), (3) |
| 49 |
master-bin.000001 # Table_map # # table_id: # (test.t1) |
| 50 |
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
| 51 |
master-bin.000001 # Xid # # COMMIT /* XID */ |
| 52 |
master-bin.000001 # Gtid # # GTID #-#-# |
| 53 |
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ |
| 54 |
############################################### |
| 55 |
RESET MASTER; |
| 56 |
CREATE TEMPORARY TABLE t1 (c1 int) Engine=InnoDB; |
| 57 |
INSERT INTO t1 VALUES (1), (2), (3); |
| 58 |
TRUNCATE t1; |
| 59 |
DROP TEMPORARY TABLE t1; |
| 60 |
############################################### |
| 61 |
### assertion: No event for 'TRUNCATE TABLE t1' |
| 62 |
############################################### |
| 63 |
include/show_binlog_events.inc |
| 64 |
############################################### |
| 65 |
# |
| 66 |
# Bug#12346411 SQL/LOG.CC:6509: ASSERTION `PREPARED_XIDS > 0' FAILED |
| 67 |
# |
| 68 |
DROP TABLE IF EXISTS t1, t2; |
| 69 |
CREATE TABLE t1(a INT PRIMARY KEY) engine=innodb; |
| 70 |
CREATE TABLE t2(a INT) engine=myisam; |
| 71 |
INSERT INTO t1 VALUES (1); |
| 72 |
START TRANSACTION; |
| 73 |
INSERT INTO t2 VALUES (1); |
| 74 |
INSERT IGNORE INTO t1 VALUES (1); |
| 75 |
Warnings: |
| 76 |
Warning 1062 Duplicate entry '1' for key 'PRIMARY' |
| 77 |
COMMIT; |
| 78 |
INSERT INTO t1 VALUES (2); |
| 79 |
START TRANSACTION; |
| 80 |
INSERT INTO t2 VALUES (2); |
| 81 |
UPDATE IGNORE t1 SET a=1 WHERE a=2; |
| 82 |
COMMIT; |
| 83 |
DROP TABLE t1, t2; |