mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-9099: Test encryption.innodb_encryption_discard_import fails on buildbot
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded.");
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
|
||||
@ -53,17 +54,14 @@ SET GLOBAL innodb_file_per_table = ON;
|
||||
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
ALTER TABLE t3 DISCARD TABLESPACE;
|
||||
# Discarded tablespaces should be encrypted
|
||||
# t1 yes on expecting NOT FOUND
|
||||
NOT FOUND /foobar/ in t1.ibd
|
||||
# t2 ... on expecting NOT FOUND
|
||||
NOT FOUND /temp/ in t2.ibd
|
||||
# t3 ... on expecting NOT FOUND
|
||||
NOT FOUND /barfoo/ in t3.ibd
|
||||
# List after t1 DISCARD
|
||||
t1.frm
|
||||
t2.frm
|
||||
t3.frm
|
||||
# Restarting server
|
||||
# Done restarting server
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
# Tablespaces should be still encrypted
|
||||
# t1 yes on expecting NOT FOUND
|
||||
NOT FOUND /foobar/ in t1.ibd
|
||||
@ -72,8 +70,23 @@ NOT FOUND /temp/ in t2.ibd
|
||||
# t3 ... on expecting NOT FOUND
|
||||
NOT FOUND /barfoo/ in t3.ibd
|
||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||
Warnings:
|
||||
Warning 1814 Tablespace has been discarded for table 't1'
|
||||
SELECT COUNT(1) FROM t1;
|
||||
COUNT(1)
|
||||
10000
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
Warnings:
|
||||
Warning 1814 Tablespace has been discarded for table 't2'
|
||||
SELECT COUNT(1) FROM t2;
|
||||
COUNT(1)
|
||||
10000
|
||||
ALTER TABLE t3 IMPORT TABLESPACE;
|
||||
Warnings:
|
||||
Warning 1814 Tablespace has been discarded for table 't3'
|
||||
SELECT COUNT(1) FROM t3;
|
||||
COUNT(1)
|
||||
10000
|
||||
# tablespaces should remain encrypted after import
|
||||
# t1 yes on expecting NOT FOUND
|
||||
NOT FOUND /foobar/ in t1.ibd
|
||||
|
@ -4,15 +4,15 @@
|
||||
-- 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 SEARCH_RANGE = 10000000
|
||||
--let $id = `SELECT RAND()`
|
||||
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
|
||||
--let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd
|
||||
--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
|
||||
--let t1_IBD_1 = $MYSQLD_TMPDIR/t1.ibd
|
||||
--let t2_IBD_1 = $MYSQLD_TMPDIR/t2.ibd
|
||||
--let t3_IBD_1 = $MYSQLD_TMPDIR/t3.ibd
|
||||
|
||||
--disable_query_log
|
||||
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
|
||||
@ -84,12 +84,12 @@ FLUSH TABLE t1, t2, t3 FOR EXPORT;
|
||||
--error 0,1,2
|
||||
--remove_file $MYSQLD_TMPDIR/t3.ibd
|
||||
--enable_result_log
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1.cfg
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_TMPDIR/t2.cfg
|
||||
--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_TMPDIR/t2.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t3.cfg $MYSQLD_TMPDIR/t3.cfg
|
||||
--copy_file $MYSQLD_DATADIR/test/t3.ibd $MYSQLD_TMPDIR/t3.ibd
|
||||
--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
|
||||
@ -105,30 +105,34 @@ ALTER TABLE t1 DISCARD TABLESPACE;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
ALTER TABLE t3 DISCARD TABLESPACE;
|
||||
|
||||
--sleep 5
|
||||
--echo # Discarded tablespaces should be encrypted
|
||||
--let SEARCH_PATTERN=foobar
|
||||
--echo # t1 yes on expecting NOT FOUND
|
||||
-- let SEARCH_FILE=$t1_IBD_1
|
||||
-- source include/search_pattern_in_file.inc
|
||||
--let SEARCH_PATTERN=temp
|
||||
--echo # t2 ... on expecting NOT FOUND
|
||||
-- let SEARCH_FILE=$t2_IBD_1
|
||||
-- source include/search_pattern_in_file.inc
|
||||
--echo # t3 ... on expecting NOT FOUND
|
||||
--let SEARCH_PATTERN=barfoo
|
||||
-- let SEARCH_FILE=$t3_IBD_1
|
||||
-- source include/search_pattern_in_file.inc
|
||||
|
||||
--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
|
||||
|
||||
--copy_file $MYSQLD_TMPDIR/t1.cfg $MYSQLD_DATADIR/test/t1.cfg
|
||||
--copy_file $MYSQLD_TMPDIR/t1.ibd $MYSQLD_DATADIR/test/t1.ibd
|
||||
--copy_file $MYSQLD_TMPDIR/t2.cfg $MYSQLD_DATADIR/test/t2.cfg
|
||||
--copy_file $MYSQLD_TMPDIR/t2.ibd $MYSQLD_DATADIR/test/t2.ibd
|
||||
--copy_file $MYSQLD_TMPDIR/t3.cfg $MYSQLD_DATADIR/test/t3.cfg
|
||||
--copy_file $MYSQLD_TMPDIR/t3.ibd $MYSQLD_DATADIR/test/t3.ibd
|
||||
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
|
||||
@ -146,8 +150,11 @@ ALTER TABLE t3 DISCARD TABLESPACE;
|
||||
-- source include/search_pattern_in_file.inc
|
||||
|
||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||
SELECT COUNT(1) FROM t1;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
SELECT COUNT(1) FROM t2;
|
||||
ALTER TABLE t3 IMPORT TABLESPACE;
|
||||
SELECT COUNT(1) FROM t3;
|
||||
|
||||
--sleep 5
|
||||
--echo # tablespaces should remain encrypted after import
|
||||
|
Reference in New Issue
Block a user