mariadb/mysql-test/suite/binlog_in_engine/binlog_legacy_pos.test
Kristian Nielsen d496e5278d MDEV-34705: Binlog-in-engine: Integration with server-layer code
Mostly various fixes to avoid initializing or creating any data or files for
the legacy binlog.

A possible later refinement could be to sub-class the binlog class
differently for legacy and in-engine binlogs, writing separate virtual
functions for behaviour that differ, extracting common functionality into
sub-methods. This could remove some if (opt_binlog_engine_hton)
conditionals.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2025-04-10 19:16:55 +02:00

45 lines
1.6 KiB
Text

--source include/have_binlog_format_mixed.inc
--source include/have_innodb_binlog.inc
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 0);
--connect(con1,localhost,root,,)
START TRANSACTION WITH CONSISTENT SNAPSHOT;
--connect(con2,localhost,root,,)
--echo *** Connection sees current position by default.
--connection default
INSERT INTO t1 VALUES (2, 0);
FLUSH BINARY LOGS;
INSERT INTO t1 VALUES (3, 0);
--let $binlog_file= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_file', Value, 1)
--let $binlog_start= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_position', Value, 1)
--let $binlog_limit= 0, 3
INSERT INTO t1 VALUES (4, 0);
SELECT * FROM t1 ORDER BY a;
--source include/show_binlog_events.inc
--echo *** START TRANSACTION WITH CONSISTENT SNAPSHOT sees position consistent with read view.
--connection con1
--let $binlog_file= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_file', Value, 1)
--let $binlog_start= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_position', Value, 1)
SELECT * FROM t1 ORDER BY a;
--source include/show_binlog_events.inc
--echo *** Connection with no active transaction sees the current position.
--connection con2
--let $binlog_file= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_file', Value, 1)
--let $binlog_start= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_position', Value, 1)
--connection default
INSERT INTO t1 VALUES (5, 0);
--connection con2
SELECT * FROM t1 ORDER BY a;
--source include/show_binlog_events.inc
--connection default
--disconnect con1
--disconnect con2
DROP TABLE t1;