mariadb/mysql-test/suite/binlog_in_engine/binlog_restart.result
Kristian Nielsen f26803103b Binlog-in-engine: Fix bug when restarting on existing binlog
When starting on a new binlog, during server initialization we force
initialization and durable sync to disk of the initial header page and gtid
state record of the new file_no=0. But the code mistakenly took this code
path also when restarting on an existing binlog.

If the server was restarted on a binlog with current position exactly at the
end of a page, this caused an attempt to write a zero byte record at the
start of the next page (when that page_no was not divisible by the
--innodb-binlog-state-interval), which caused double creation of the page on
the next real write and invalid state/assertion in the page fifo.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2026-01-16 23:05:04 +01:00

21 lines
734 B
Text

CREATE TABLE t1(a INT PRIMARY KEY, b INT, c LONGBLOB) ENGINE=InnoDB;
*** Test restarting the server on an existing binlog
include/reset_master.inc
SET SESSION binlog_annotate_row_events= 0;
INSERT INTO t1 VALUES (1, 0, REPEAT('@', 31760));
INSERT INTO t1 VALUES (2, 0, REPEAT('@', 100));
RESET MASTER;
INSERT INTO t1 VALUES (3, 0, REPEAT('&', 31760));
INSERT INTO t1 VALUES (4, 0, REPEAT('&', $length));
# restart
SELECT @@GLOBAL.max_binlog_size;
@@GLOBAL.max_binlog_size
262144
RESET MASTER;
INSERT INTO t1 VALUES (5, 0, REPEAT('@', 243700));
INSERT INTO t1 VALUES (6, 0, REPEAT('@', 100));
RESET MASTER;
INSERT INTO t1 VALUES (7, 0, REPEAT('&', 243700));
INSERT INTO t1 VALUES (8, 0, REPEAT('&', $length));
# restart
DROP TABLE t1;