| 1 |
create table t1 (a int primary key, b text) engine=innodb; |
| 2 |
connect trx1_rollback,localhost,root,,; |
| 3 |
CREATE TABLE t_x (a int) engine=MEMORY; |
| 4 |
SET binlog_format=row; |
| 5 |
CREATE TEMPORARY TABLE tt_tmp ( id INT ) ENGINE = Memory; |
| 6 |
BEGIN; |
| 7 |
insert into t_x values (1); |
| 8 |
drop temporary table tt_tmp; |
| 9 |
insert into t1 values (99, "gotta log first"); |
| 10 |
SET DEBUG_SYNC= 'reset'; |
| 11 |
SET DEBUG_SYNC= "before_group_commit_queue SIGNAL trx1_at_log WAIT_FOR trx1_go"; |
| 12 |
ROLLBACK; |
| 13 |
connect trx2_commit,localhost,root,,; |
| 14 |
insert into t1 values (99, "second best in binlog"); |
| 15 |
connection default; |
| 16 |
SET DEBUG_SYNC= "now WAIT_FOR trx1_at_log"; |
| 17 |
SET DEBUG_SYNC= "now SIGNAL trx1_go"; |
| 18 |
connection trx2_commit; |
| 19 |
select * from t1; |
| 20 |
a b |
| 21 |
99 second best in binlog |
| 22 |
# Prove the logging order is Trx1, Trx2 |
| 23 |
include/show_binlog_events.inc |
| 24 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 25 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 26 |
master-bin.000001 # Annotate_rows # # insert into t_x values (1) |
| 27 |
master-bin.000001 # Table_map # # table_id: # (test.t_x) |
| 28 |
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
| 29 |
master-bin.000001 # Query # # COMMIT |
| 30 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 31 |
master-bin.000001 # Annotate_rows # # insert into t1 values (99, "gotta log first") |
| 32 |
master-bin.000001 # Table_map # # table_id: # (test.t1) |
| 33 |
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
| 34 |
master-bin.000001 # Query # # ROLLBACK |
| 35 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 36 |
master-bin.000001 # Query # # use `test`; insert into t1 values (99, "second best in binlog") |
| 37 |
master-bin.000001 # Xid # # COMMIT /* XID */ |
| 38 |
drop table t_x, t1; |
| 39 |
disconnect trx1_rollback; |
| 40 |
disconnect trx2_commit; |
| 41 |
# end of the tests |