summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-09-11 16:45:36 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2017-09-12 05:57:05 +0000
commit31774f0ede81d77d889061324930d3d0066c653a (patch)
treeb9131beffe7791a39a21434dcdfe492543a9f3a7 /mysql-test/suite
parent6b5c0effe43d5cfd19d3aff0fdb5fb6f1b6d41d3 (diff)
downloadmariadb-git-31774f0ede81d77d889061324930d3d0066c653a.tar.gz
MDEV-13563 lock DDL for mariabackup in 10.2
Implement lock-ddl-per-table option that locks tables before it is copied to backup, and helds the lock until backup finished The "DDL-lock" itself is implemented as "SELECT * from <table> LIMIT 0", inside a transaction, and "COMMIT" of this transaction is the DDL-unlock.
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/mariabackup/lock_ddl_per_table.result4
-rw-r--r--mysql-test/suite/mariabackup/lock_ddl_per_table.test12
-rw-r--r--mysql-test/suite/mariabackup/suite.opt2
3 files changed, 17 insertions, 1 deletions
diff --git a/mysql-test/suite/mariabackup/lock_ddl_per_table.result b/mysql-test/suite/mariabackup/lock_ddl_per_table.result
new file mode 100644
index 00000000000..d0137a1e072
--- /dev/null
+++ b/mysql-test/suite/mariabackup/lock_ddl_per_table.result
@@ -0,0 +1,4 @@
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+# xtrabackup backup
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/lock_ddl_per_table.test b/mysql-test/suite/mariabackup/lock_ddl_per_table.test
new file mode 100644
index 00000000000..5b45aa7c61b
--- /dev/null
+++ b/mysql-test/suite/mariabackup/lock_ddl_per_table.test
@@ -0,0 +1,12 @@
+--source include/have_debug.inc
+
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+echo # xtrabackup backup;
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --lock-ddl-per-table=1 --dbug=+d,check_mdl_lock_works;
+--enable_result_log
+DROP TABLE t;
+rmdir $targetdir; \ No newline at end of file
diff --git a/mysql-test/suite/mariabackup/suite.opt b/mysql-test/suite/mariabackup/suite.opt
index ba78b2d8957..defba074293 100644
--- a/mysql-test/suite/mariabackup/suite.opt
+++ b/mysql-test/suite/mariabackup/suite.opt
@@ -1 +1 @@
---innodb --loose-changed_page_bitmaps --innodb-file-format=Barracuda \ No newline at end of file
+--innodb --loose-changed_page_bitmaps --innodb-file-format=Barracuda --innodb-sys-tables \ No newline at end of file