summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorVlad Lesin <vlad_lesin@mail.ru>2020-04-20 17:23:43 +0300
committerVlad Lesin <vlad_lesin@mail.ru>2020-04-21 10:34:37 +0300
commit0efe1971c6f0c7c2edf906372550bef234ebb8a1 (patch)
treec79fb38acaa3ca3d198f8664e15113ce3b7ac8f5 /mysql-test
parent36bddacf6b9177587eb5364e81f42a482df7d73f (diff)
downloadmariadb-git-0efe1971c6f0c7c2edf906372550bef234ebb8a1.tar.gz
MDEV-19347: Mariabackup does not honor ignore_db_dirs from serverbb-10.2-MDEV-19347-ignore_db_dirs
config. The solution is to read the system variable value on startup and to fill databases_exclude_hash. xb_load_list_string() became non-static and was reformatted. The system variable value is read and processed in get_mysql_vars(), which was also reformatted.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/mariabackup/partial_exclude.opt2
-rw-r--r--mysql-test/suite/mariabackup/partial_exclude.result3
-rw-r--r--mysql-test/suite/mariabackup/partial_exclude.test18
3 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/suite/mariabackup/partial_exclude.opt b/mysql-test/suite/mariabackup/partial_exclude.opt
new file mode 100644
index 00000000000..872335edb71
--- /dev/null
+++ b/mysql-test/suite/mariabackup/partial_exclude.opt
@@ -0,0 +1,2 @@
+--ignore-db-dirs=db3
+--ignore-db-dirs=db4
diff --git a/mysql-test/suite/mariabackup/partial_exclude.result b/mysql-test/suite/mariabackup/partial_exclude.result
index 0da9b547caa..628613040e0 100644
--- a/mysql-test/suite/mariabackup/partial_exclude.result
+++ b/mysql-test/suite/mariabackup/partial_exclude.result
@@ -1,3 +1,6 @@
+select @@ignore_db_dirs;
+@@ignore_db_dirs
+db3,db4
CREATE TABLE t1(i INT) ENGINE INNODB;
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(i int) ENGINE INNODB;
diff --git a/mysql-test/suite/mariabackup/partial_exclude.test b/mysql-test/suite/mariabackup/partial_exclude.test
index cd21ecff29b..99d14e58231 100644
--- a/mysql-test/suite/mariabackup/partial_exclude.test
+++ b/mysql-test/suite/mariabackup/partial_exclude.test
@@ -1,6 +1,13 @@
#--source include/innodb_page_size.inc
# Test --databases-exclude and --tables-exclude feature of xtrabackup 2.3.8
+select @@ignore_db_dirs;
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+mkdir $MYSQLD_DATADIR/db3;
+mkdir $MYSQLD_DATADIR/db4;
+mkdir $MYSQLD_DATADIR/db5;
CREATE TABLE t1(i INT) ENGINE INNODB;
INSERT INTO t1 VALUES(1);
@@ -24,8 +31,19 @@ list_files $targetdir/test *.ibd;
# check that db2 database is not in the backup (excluded)
--error 1
list_files $targetdir/db2 *.ibd;
+# check that db3 database is not in the backup (excluded)
+--error 1
+list_files $targetdir/db3 *.ibd;
+# check that db4 database is not in the backup (excluded)
+--error 1
+list_files $targetdir/db4 *.ibd;
+# check that db5 database is in the backup
+list_files $targetdir/db5 *.ibd;
DROP TABLE t1;
DROP TABLE t2;
DROP DATABASE db2;
+rmdir $MYSQLD_DATADIR/db3;
+rmdir $MYSQLD_DATADIR/db4;
+rmdir $MYSQLD_DATADIR/db5;
rmdir $targetdir;