summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/mariabackup/xb_rocksdb.test
blob: 6c23fe3d1ea99f9a895cf4b6b117df7456819e00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--source include/have_rocksdb.inc

CREATE TABLE t(i INT) ENGINE ROCKSDB;
INSERT INTO t VALUES(1);
echo # xtrabackup backup;
# we'll backup to both directory and to stream to restore that later

let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
let $stream=$MYSQLTEST_VARDIR/tmp/backup.xb;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir $backup_extra_param;
--enable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10  --stream=xbstream > $stream 2>$MYSQLTEST_VARDIR/tmp/backup_stream.log;

INSERT INTO t VALUES(2);


echo # xtrabackup prepare;
--disable_result_log
exec $XTRABACKUP  --prepare --target-dir=$targetdir;
-- source include/restart_and_restore.inc
--enable_result_log

SELECT * FROM t;

rmdir $targetdir;
mkdir $targetdir;


echo # xbstream extract;

exec $XBSTREAM -x -C $targetdir  < $stream;

echo # xtrabackup prepare;
--disable_result_log
exec $XTRABACKUP --prepare --target-dir=$targetdir;

let $_datadir= `SELECT @@datadir`;
echo # shutdown server;
--source include/shutdown_mysqld.inc
echo # remove datadir;
rmdir $_datadir;
echo # xtrabackup move back;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --move-back --datadir=$_datadir --target-dir=$targetdir $copy_back_extra_param;
echo # restart server;
--source include/start_mysqld.inc

--enable_result_log
SELECT * FROM t;

DROP TABLE t;
rmdir $targetdir;