RESET MASTER;
# Connection default
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
SHOW MASTER STATUS;
File	Position	Binlog_Do_DB	Binlog_Ignore_DB
master-bin.000001	380		
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name	Value
Binlog_snapshot_file	master-bin.000001
Binlog_snapshot_position	380
BEGIN;
INSERT INTO t1 VALUES (0, "");
# Connection con1
BEGIN;
INSERT INTO t1 VALUES (1, "");
# Connection con2
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam;
BEGIN;
INSERT INTO t1 VALUES (2, "first");
INSERT INTO t2 VALUES (2);
INSERT INTO t1 VALUES (2, "second");
# Connection default
COMMIT;
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
# Connection con3
BEGIN;
INSERT INTO t1 VALUES (3, "");
INSERT INTO t2 VALUES (3);
# Connection con4
BEGIN;
INSERT INTO t1 VALUES (4, "");
COMMIT;
# Connection default
SELECT * FROM t1 ORDER BY a,b;
a	b
0	
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name	Value
Binlog_snapshot_file	master-bin.000001
Binlog_snapshot_position	904
SHOW MASTER STATUS;
File	Position	Binlog_Do_DB	Binlog_Ignore_DB
master-bin.000001	1316		
SELECT * FROM t2 ORDER BY a;
a
2
3
# Connection con1
COMMIT;
# Connection con2
COMMIT;
# Connection con3
COMMIT;
FLUSH LOGS;
# Connection default
SELECT * FROM t1 ORDER BY a,b;
a	b
0	
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name	Value
Binlog_snapshot_file	master-bin.000001
Binlog_snapshot_position	904
SHOW MASTER STATUS;
File	Position	Binlog_Do_DB	Binlog_Ignore_DB
master-bin.000002	245		
COMMIT;
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name	Value
Binlog_snapshot_file	master-bin.000002
Binlog_snapshot_position	245
SHOW MASTER STATUS;
File	Position	Binlog_Do_DB	Binlog_Ignore_DB
master-bin.000002	245		
SHOW BINLOG EVENTS;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	4	Format_desc	1	245	Server ver: #, Binlog ver: #
master-bin.000001	245	Query	1	380	use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
master-bin.000001	380	Query	1	492	use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
master-bin.000001	492	Query	1	560	BEGIN
master-bin.000001	560	Query	1	648	use `test`; INSERT INTO t2 VALUES (2)
master-bin.000001	648	Query	1	717	COMMIT
master-bin.000001	717	Query	1	785	BEGIN
master-bin.000001	785	Query	1	877	use `test`; INSERT INTO t1 VALUES (0, "")
master-bin.000001	877	Xid	1	904	COMMIT /* XID */
master-bin.000001	904	Query	1	972	BEGIN
master-bin.000001	972	Query	1	1060	use `test`; INSERT INTO t2 VALUES (3)
master-bin.000001	1060	Query	1	1129	COMMIT
master-bin.000001	1129	Query	1	1197	BEGIN
master-bin.000001	1197	Query	1	1289	use `test`; INSERT INTO t1 VALUES (4, "")
master-bin.000001	1289	Xid	1	1316	COMMIT /* XID */
master-bin.000001	1316	Query	1	1384	BEGIN
master-bin.000001	1384	Query	1	1476	use `test`; INSERT INTO t1 VALUES (1, "")
master-bin.000001	1476	Xid	1	1503	COMMIT /* XID */
master-bin.000001	1503	Query	1	1571	BEGIN
master-bin.000001	1571	Query	1	1668	use `test`; INSERT INTO t1 VALUES (2, "first")
master-bin.000001	1668	Query	1	1766	use `test`; INSERT INTO t1 VALUES (2, "second")
master-bin.000001	1766	Xid	1	1793	COMMIT /* XID */
master-bin.000001	1793	Query	1	1861	BEGIN
master-bin.000001	1861	Query	1	1953	use `test`; INSERT INTO t1 VALUES (3, "")
master-bin.000001	1953	Xid	1	1980	COMMIT /* XID */
master-bin.000001	1980	Rotate	1	2024	master-bin.000002;pos=4
*** MDEV-7310: last_commit_pos_offset set to wrong value after binlog rotate in group comm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