Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-23335 MariaBackup Incremental Does Not Reflect Dropped/Created D…
…atabases
- Loading branch information
Showing
3 changed files
with
146 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| call mtr.add_suppression("InnoDB: New log files created"); | ||
| # | ||
| # Start of 10.3 tests | ||
| # | ||
| # | ||
| # MDEV-23335 MariaBackup Incremental Does Not Reflect Dropped/Created Databases | ||
| # | ||
| CREATE DATABASE db1; | ||
| CREATE DATABASE db2; | ||
| CREATE TABLE db1.t1 (a INT) ENGINE=MyISAM; | ||
| CREATE TABLE db1.t2 (a INT) ENGINE=InnoDB; | ||
| # Create base backup | ||
| DROP DATABASE db1; | ||
| # Create incremental backup | ||
| # Remove incremental_dir/db2/db.opt file to make incremental_dir/db2/ empty | ||
| # Prepare base backup, apply incremental one | ||
| # shutdown server | ||
| # remove datadir | ||
| # xtrabackup move back | ||
| # restart server | ||
| # Expect no 'db1' in the output, because it was really dropped. | ||
| # Expect 'db2' in the ouput, because it was not dropped! | ||
| # (its incremental directory was emptied only) | ||
| SHOW DATABASES LIKE 'db%'; | ||
| Database (db%) | ||
| db2 | ||
| DROP DATABASE db2; | ||
| # | ||
| # End of 10.3 tests | ||
| # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --source include/have_innodb.inc | ||
| call mtr.add_suppression("InnoDB: New log files created"); | ||
|
|
||
| --echo # | ||
| --echo # Start of 10.3 tests | ||
| --echo # | ||
|
|
||
| --echo # | ||
| --echo # MDEV-23335 MariaBackup Incremental Does Not Reflect Dropped/Created Databases | ||
| --echo # | ||
|
|
||
| --let $datadir=`SELECT @@datadir` | ||
| --let $basedir=$MYSQLTEST_VARDIR/tmp/backup | ||
| --let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1 | ||
|
|
||
| # Create two databases: | ||
| # - db1 is dropped normally below | ||
| # - db2 is used to cover a corner case: its db.opt file is removed | ||
|
|
||
| # Incremental backup contains: | ||
| # - no directory for db1 | ||
| # - an empty directory for db2 (after we remove db2/db.opt) | ||
|
|
||
|
|
||
| CREATE DATABASE db1; | ||
| CREATE DATABASE db2; | ||
|
|
||
| # Add some tables to db1 | ||
| CREATE TABLE db1.t1 (a INT) ENGINE=MyISAM; | ||
| CREATE TABLE db1.t2 (a INT) ENGINE=InnoDB; | ||
|
|
||
| --echo # Create base backup | ||
| --disable_result_log | ||
| --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir | ||
| --enable_result_log | ||
|
|
||
| DROP DATABASE db1; | ||
|
|
||
| --echo # Create incremental backup | ||
| --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir | ||
|
|
||
| --echo # Remove incremental_dir/db2/db.opt file to make incremental_dir/db2/ empty | ||
| --remove_file $incremental_dir/db2/db.opt | ||
|
|
||
|
|
||
| --echo # Prepare base backup, apply incremental one | ||
| --disable_result_log | ||
| --exec $XTRABACKUP --prepare --target-dir=$basedir | ||
| --exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir | ||
| --enable_result_log | ||
|
|
||
| --let $targetdir=$basedir | ||
| --source include/restart_and_restore.inc | ||
| --enable_result_log | ||
|
|
||
| --echo # Expect no 'db1' in the output, because it was really dropped. | ||
| --echo # Expect 'db2' in the ouput, because it was not dropped! | ||
| --echo # (its incremental directory was emptied only) | ||
|
|
||
| SHOW DATABASES LIKE 'db%'; | ||
| DROP DATABASE db2; | ||
|
|
||
| --rmdir $basedir | ||
| --rmdir $incremental_dir | ||
|
|
||
| --echo # | ||
| --echo # End of 10.3 tests | ||
| --echo # |