summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extra/mariabackup/xtrabackup.cc5
-rw-r--r--mysql-test/suite/mariabackup/compress_qpress.result15
-rw-r--r--mysql-test/suite/mariabackup/compress_qpress.test24
-rw-r--r--mysql-test/suite/mariabackup/suite.pm2
4 files changed, 46 insertions, 0 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 2c67f48af4a..ad8a9241478 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -837,6 +837,11 @@ struct my_option xb_client_options[] =
(uchar*) &opt_incremental_history_uuid, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"remove-original", OPT_REMOVE_ORIGINAL, "Remove .qp files after decompression.",
+ (uchar *) &opt_remove_original,
+ (uchar *) &opt_remove_original,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+
{"ftwrl-wait-query-type", OPT_LOCK_WAIT_QUERY_TYPE,
"This option specifies which types of queries are allowed to complete "
"before innobackupex will issue the global lock. Default is all.",
diff --git a/mysql-test/suite/mariabackup/compress_qpress.result b/mysql-test/suite/mariabackup/compress_qpress.result
new file mode 100644
index 00000000000..f8dfb46e4db
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compress_qpress.result
@@ -0,0 +1,15 @@
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+# xtrabackup backup
+INSERT INTO t VALUES(2);
+# xtrabackup prepare
+t.frm.qp
+t.ibd.qp
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * FROM t;
+i
+1
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/compress_qpress.test b/mysql-test/suite/mariabackup/compress_qpress.test
new file mode 100644
index 00000000000..f86efe44e5d
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compress_qpress.test
@@ -0,0 +1,24 @@
+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 --compress --target-dir=$targetdir;
+--enable_result_log
+
+INSERT INTO t VALUES(2);
+
+
+echo # xtrabackup prepare;
+--disable_result_log
+list_files $targetdir/test *.qp;
+exec $XTRABACKUP --decompress --remove-original --target-dir=$targetdir;
+list_files $targetdir/test *.qp;
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+
+SELECT * FROM t;
+DROP TABLE t;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/suite.pm b/mysql-test/suite/mariabackup/suite.pm
index 26d5c06cdad..b96b8a6c39d 100644
--- a/mysql-test/suite/mariabackup/suite.pm
+++ b/mysql-test/suite/mariabackup/suite.pm
@@ -3,6 +3,7 @@ package My::Suite::MariaBackup;
@ISA = qw(My::Suite);
use My::Find;
use File::Basename;
+use File::Which;
use strict;
return "Not run for embedded server" if $::opt_embedded_server;
@@ -26,6 +27,7 @@ $ENV{INNOBACKUPEX}= "$mariabackup_exe --innobackupex";
sub skip_combinations {
my %skip;
$skip{'include/have_file_key_management.inc'} = 'needs file_key_management plugin' unless $ENV{FILE_KEY_MANAGEMENT_SO};
+ $skip{'compress_qpress.test'}= 'needs qpress executable in PATH' unless which 'qpress';
%skip;
}