summaryrefslogtreecommitdiff
path: root/mysql-test/suite/mariabackup
diff options
context:
space:
mode:
authorVlad Lesin <vlad_lesin@mail.ru>2019-10-01 03:23:33 +0300
committerVlad Lesin <vlad_lesin@mail.ru>2019-10-01 13:57:24 +0300
commitedda2fd149e4fcb7c9640be4d05d2c25013b2b71 (patch)
treeeab80184811c34a50e41f3272a22b491e426913a /mysql-test/suite/mariabackup
parentf203245e9edcfb202c1b23fba186be043ce6002d (diff)
downloadmariadb-git-edda2fd149e4fcb7c9640be4d05d2c25013b2b71.tar.gz
MDEV-20703: mariabackup creates binlog files in server binlog directory on --prepare --export step
When "--export" mariabackup option is used, mariabackup starts the server in bootstrap mode to generate *.cfg files for the certain innodb tables. The started instance of the server reads options from the file, pointed out in "--defaults-file" mariabackup option. If the server uses the same config file as mariabackup, and binlog is switched on in that config file, then "mariabackup --prepare --export" will create binary log files in the server's binary log directory, what can cause issues. The fix is to add "--skip-log-bin" in mysld options when the server is started to generate *.cfg files.
Diffstat (limited to 'mysql-test/suite/mariabackup')
-rw-r--r--mysql-test/suite/mariabackup/partial.test18
1 files changed, 16 insertions, 2 deletions
diff --git a/mysql-test/suite/mariabackup/partial.test b/mysql-test/suite/mariabackup/partial.test
index 559ba155972..53388b1947f 100644
--- a/mysql-test/suite/mariabackup/partial.test
+++ b/mysql-test/suite/mariabackup/partial.test
@@ -12,7 +12,7 @@ CREATE TABLE t2(i int) ENGINE INNODB;
echo # xtrabackup backup;
-let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+let targetdir=$MYSQLTEST_VARDIR/tmp/backup;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup "--tables=test.*1" --target-dir=$targetdir;
--enable_result_log
@@ -25,13 +25,27 @@ EOF
write_file $targetdir/test/junk.frm;
EOF
+let server_cnf=$targetdir/server.cnf;
+copy_file $MYSQLTEST_VARDIR/my.cnf $server_cnf;
+
+# Emulate server config file turnes on binary logs
+perl;
+my $binlog_path="$ENV{'targetdir'}/mysqld-bin";
+my $config_path=$ENV{'server_cnf'};
+open(my $fd, '>>', "$config_path");
+print $fd "\n[mysqld]\n";
+print $fd "log-bin=$binlog_path\n";
+close $fd;
+EOF
echo # xtrabackup prepare;
--disable_result_log
-exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.1 --prepare --export --target-dir=$targetdir;
+exec $XTRABACKUP --defaults-file=$server_cnf --defaults-group-suffix=.1 --prepare --export --target-dir=$targetdir;
--enable_result_log
list_files $targetdir/test *.cfg;
+# There must not be binary logs created on --prepare step
+list_files $targetdir/ mysqld-bin.*;
let $MYSQLD_DATADIR= `select @@datadir`;
ALTER TABLE t1 DISCARD TABLESPACE;