mariadb/mysql-test/suite/mariabackup/incremental_backup.test
2017-11-09 14:45:39 +02:00

43 lines
1.3 KiB
Text

--source include/innodb_page_size.inc
call mtr.add_suppression("InnoDB: New log files created");
let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
CREATE TABLE t(i INT PRIMARY KEY) ENGINE INNODB;
BEGIN;
INSERT INTO t VALUES(2);
connect (con1,localhost,root,,);
SET GLOBAL innodb_flush_log_at_trx_commit = 1;
INSERT INTO t VALUES(1);
echo # Create full backup , modify table, then create incremental/differential backup;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
--enable_result_log
BEGIN;
INSERT INTO t VALUES(0);
DELETE FROM t WHERE i=0;
connection default;
COMMIT;
SELECT * FROM t;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir;
--disable_result_log
echo # Prepare full backup, apply incremental one;
exec $XTRABACKUP --prepare --target-dir=$basedir;
exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir ;
disconnect con1;
echo # Restore and check results;
let $targetdir=$basedir;
-- source include/restart_and_restore.inc
--enable_result_log
SELECT * FROM t;
DROP TABLE t;
# Cleanup
rmdir $basedir;
rmdir $incremental_dir;