1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-9099: Test encryption.innodb_encryption_discard_import fails on buildbot

This commit is contained in:
Jan Lindström
2016-10-28 13:59:35 +03:00
parent de0f77a2a8
commit bb4b8c7470
3 changed files with 154 additions and 112 deletions

View File

@ -2,12 +2,12 @@
-- source include/have_example_key_management_plugin.inc
-- source include/not_valgrind.inc
-- source include/not_embedded.inc
-- source include/not_windows.inc
call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded.");
--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
--let $MYSQLD_DATADIR = `SELECT @@datadir`
let $MYSQLD_TMPDIR = `SELECT @@tmpdir`;
let $MYSQLD_DATADIR = `SELECT @@datadir`;
--let SEARCH_RANGE = 10000000
--let $id = `SELECT RAND()`
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
@ -66,88 +66,25 @@ set autocommit=1;
-- let SEARCH_FILE=$t3_IBD
-- source include/search_pattern_in_file.inc
FLUSH TABLE t1, t2, t3 FOR EXPORT;
--echo # List before copying files
let MYSQLD_DATADIR =`SELECT @@datadir`;
--list_files $MYSQLD_DATADIR/test
FLUSH TABLES t1, t2, t3 FOR EXPORT;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1","t2","t3");
EOF
--list_files $MYSQLD_DATADIR/test
--disable_result_log
--error 0,1,2
--remove_file $MYSQLD_TMPDIR/t1.cfg
--error 0,1,2
--remove_file $MYSQLD_TMPDIR/t1.ibd
--error 0,1,2
--remove_file $MYSQLD_TMPDIR/t2.cfg
--error 0,1,2
--remove_file $MYSQLD_TMPDIR/t2.ibd
--error 0,1,2
--remove_file $MYSQLD_TMPDIR/t3.cfg
--error 0,1,2
--remove_file $MYSQLD_TMPDIR/t3.ibd
--enable_result_log
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1$id.cfg
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1$id.ibd
--copy_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_TMPDIR/t2$id.cfg
--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_TMPDIR/t2$id.ibd
--copy_file $MYSQLD_DATADIR/test/t3.cfg $MYSQLD_TMPDIR/t3$id.cfg
--copy_file $MYSQLD_DATADIR/test/t3.ibd $MYSQLD_TMPDIR/t3$id.ibd
UNLOCK TABLES;
--echo # Restarting server
-- source include/restart_mysqld.inc
--echo # Done restarting server
--echo # List before t1 DISCARD
--list_files $MYSQLD_DATADIR/test
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
ALTER TABLE t1 DISCARD TABLESPACE;
ALTER TABLE t2 DISCARD TABLESPACE;
ALTER TABLE t3 DISCARD TABLESPACE;
--echo # List after t1 DISCARD
--list_files $MYSQLD_DATADIR/test
--error 0,1,2
--remove_file $MYSQLD_DATADIR/test/t1.cfg
--error 0,1,2
--remove_file $MYSQLD_DATADIR/test/t1.ibd
--error 0,1,2
--remove_file $MYSQLD_DATADIR/test/t2.cfg
--error 0,1,2
--remove_file $MYSQLD_DATADIR/test/t2.ibd
--error 0,1,2
--remove_file $MYSQLD_DATADIR/test/t3.cfg
--error 0,1,2
--remove_file $MYSQLD_DATADIR/test/t3.ibd
--enable_result_log
--echo # Restarting server
-- source include/restart_mysqld.inc
--echo # Done restarting server
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
--copy_file $MYSQLD_TMPDIR/t1$id.cfg $MYSQLD_DATADIR/test/t1.cfg
--copy_file $MYSQLD_TMPDIR/t1$id.ibd $MYSQLD_DATADIR/test/t1.ibd
--copy_file $MYSQLD_TMPDIR/t2$id.cfg $MYSQLD_DATADIR/test/t2.cfg
--copy_file $MYSQLD_TMPDIR/t2$id.ibd $MYSQLD_DATADIR/test/t2.ibd
--copy_file $MYSQLD_TMPDIR/t3$id.cfg $MYSQLD_DATADIR/test/t3.cfg
--copy_file $MYSQLD_TMPDIR/t3$id.ibd $MYSQLD_DATADIR/test/t3.ibd
--sleep 5
--echo # Tablespaces should be still encrypted
--let SEARCH_PATTERN=foobar
--echo # t1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=temp
--echo # t2 ... on expecting NOT FOUND
-- let SEARCH_FILE=$t2_IBD
-- source include/search_pattern_in_file.inc
--echo # t3 ... on expecting NOT FOUND
--let SEARCH_PATTERN=barfoo
-- let SEARCH_FILE=$t3_IBD
-- source include/search_pattern_in_file.inc
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1","t2","t3");
ib_restore_tablespaces("test", "t1","t2","t3");
EOF
ALTER TABLE t1 IMPORT TABLESPACE;
SELECT COUNT(1) FROM t1;