summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/mariabackup/incremental_encrypted.test
blob: d4619e1f454da304352114800e788f3b63567f5b (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
--source include/innodb_page_size.inc
--source include/innodb_undo_tablespaces.inc

if (!$EXAMPLE_KEY_MANAGEMENT_SO)
{
  --skip needs example_key_management plugin
}
call mtr.add_suppression("InnoDB: New log files created");

if (`select @@innodb_page_size=65536`)
{
  # this needs too much memory for 32bit
  source include/have_64bit.inc;
}


let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;


CREATE TABLE t(i INT) ENGINE INNODB ENCRYPTED=YES;
INSERT INTO t VALUES(1);


echo # Create full backup , modify table, then create incremental/differential backup;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf  --backup --parallel=10 --target-dir=$basedir;
--enable_result_log

SET GLOBAL innodb_flush_log_at_trx_commit = 1;
INSERT INTO t VALUES(2);
SELECT * FROM t;

--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf   --backup --parallel=10 --target-dir=$incremental_dir --incremental-basedir=$basedir;
echo # Prepare full backup, apply incremental one;
exec $XTRABACKUP --prepare --target-dir=$basedir;
exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir;

echo # Restore and check results;
let $targetdir=$basedir;
-- source include/restart_and_restore.inc
--enable_result_log

SELECT * FROM t;
DROP TABLE t;

# Cleanup
rmdir $basedir;
rmdir $incremental_dir;