mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-34705: Binlog in Engine: Resume from existing binlogs
When (re-)starting the server, check for any existing binlog files. Open the last two found (if any), and find the position that was last written before the restart. Continue binlogging from that point rather than creating new binlog files. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_binlog.inc
|
||||
--source include/have_binlog_format_mixed.inc
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
22
mysql-test/suite/binlog/t/binlog_in_engine2.test
Normal file
22
mysql-test/suite/binlog/t/binlog_in_engine2.test
Normal file
File diff suppressed because one or more lines are too long
19
mysql-test/suite/binlog/t/binlog_in_engine_restart.test
Normal file
19
mysql-test/suite/binlog/t/binlog_in_engine_restart.test
Normal file
@@ -0,0 +1,19 @@
|
||||
--source include/have_innodb_binlog.inc
|
||||
--source include/have_binlog_format_mixed.inc
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, 0);
|
||||
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog1.txt
|
||||
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
INSERT INTO t1 VALUES (2, 0);
|
||||
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog2.txt
|
||||
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
INSERT INTO t1 VALUES (3, 0);
|
||||
|
||||
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog3.txt
|
||||
|
||||
DROP TABLE t1;
|
Reference in New Issue
Block a user