Skip to content

Commit c0216f1

Browse files
author
Jan Lindström
committed
MDEV-9099: Test encryption.innodb_encryption_discard_import fails on buildbot
1 parent 3228ad3 commit c0216f1

File tree

2 files changed

+57
-37
lines changed

2 files changed

+57
-37
lines changed

mysql-test/suite/encryption/r/innodb_encryption_discard_import.result

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded.");
12
SET GLOBAL innodb_file_format = `Barracuda`;
23
SET GLOBAL innodb_file_per_table = ON;
34
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;
5354
ALTER TABLE t1 DISCARD TABLESPACE;
5455
ALTER TABLE t2 DISCARD TABLESPACE;
5556
ALTER TABLE t3 DISCARD TABLESPACE;
56-
# Discarded tablespaces should be encrypted
57-
# t1 yes on expecting NOT FOUND
58-
NOT FOUND /foobar/ in t1.ibd
59-
# t2 ... on expecting NOT FOUND
60-
NOT FOUND /temp/ in t2.ibd
61-
# t3 ... on expecting NOT FOUND
62-
NOT FOUND /barfoo/ in t3.ibd
6357
# List after t1 DISCARD
6458
t1.frm
6559
t2.frm
6660
t3.frm
61+
# Restarting server
62+
# Done restarting server
63+
SET GLOBAL innodb_file_format = `Barracuda`;
64+
SET GLOBAL innodb_file_per_table = ON;
6765
# Tablespaces should be still encrypted
6866
# t1 yes on expecting NOT FOUND
6967
NOT FOUND /foobar/ in t1.ibd
@@ -72,8 +70,23 @@ NOT FOUND /temp/ in t2.ibd
7270
# t3 ... on expecting NOT FOUND
7371
NOT FOUND /barfoo/ in t3.ibd
7472
ALTER TABLE t1 IMPORT TABLESPACE;
73+
Warnings:
74+
Warning 1814 Tablespace has been discarded for table 't1'
75+
SELECT COUNT(1) FROM t1;
76+
COUNT(1)
77+
10000
7578
ALTER TABLE t2 IMPORT TABLESPACE;
79+
Warnings:
80+
Warning 1814 Tablespace has been discarded for table 't2'
81+
SELECT COUNT(1) FROM t2;
82+
COUNT(1)
83+
10000
7684
ALTER TABLE t3 IMPORT TABLESPACE;
85+
Warnings:
86+
Warning 1814 Tablespace has been discarded for table 't3'
87+
SELECT COUNT(1) FROM t3;
88+
COUNT(1)
89+
10000
7790
# tablespaces should remain encrypted after import
7891
# t1 yes on expecting NOT FOUND
7992
NOT FOUND /foobar/ in t1.ibd

mysql-test/suite/encryption/t/innodb_encryption_discard_import.test

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
-- source include/not_embedded.inc
55
-- source include/not_windows.inc
66

7+
call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded.");
8+
79
--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
810
--let $MYSQLD_DATADIR = `SELECT @@datadir`
911
--let SEARCH_RANGE = 10000000
12+
--let $id = `SELECT RAND()`
1013
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
1114
--let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd
1215
--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
13-
--let t1_IBD_1 = $MYSQLD_TMPDIR/t1.ibd
14-
--let t2_IBD_1 = $MYSQLD_TMPDIR/t2.ibd
15-
--let t3_IBD_1 = $MYSQLD_TMPDIR/t3.ibd
1616

1717
--disable_query_log
1818
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
@@ -84,12 +84,12 @@ FLUSH TABLE t1, t2, t3 FOR EXPORT;
8484
--error 0,1,2
8585
--remove_file $MYSQLD_TMPDIR/t3.ibd
8686
--enable_result_log
87-
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1.cfg
88-
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1.ibd
89-
--copy_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_TMPDIR/t2.cfg
90-
--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_TMPDIR/t2.ibd
91-
--copy_file $MYSQLD_DATADIR/test/t3.cfg $MYSQLD_TMPDIR/t3.cfg
92-
--copy_file $MYSQLD_DATADIR/test/t3.ibd $MYSQLD_TMPDIR/t3.ibd
87+
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1$id.cfg
88+
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1$id.ibd
89+
--copy_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_TMPDIR/t2$id.cfg
90+
--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_TMPDIR/t2$id.ibd
91+
--copy_file $MYSQLD_DATADIR/test/t3.cfg $MYSQLD_TMPDIR/t3$id.cfg
92+
--copy_file $MYSQLD_DATADIR/test/t3.ibd $MYSQLD_TMPDIR/t3$id.ibd
9393
UNLOCK TABLES;
9494

9595
--echo # Restarting server
@@ -105,30 +105,34 @@ ALTER TABLE t1 DISCARD TABLESPACE;
105105
ALTER TABLE t2 DISCARD TABLESPACE;
106106
ALTER TABLE t3 DISCARD TABLESPACE;
107107

108-
--sleep 5
109-
--echo # Discarded tablespaces should be encrypted
110-
--let SEARCH_PATTERN=foobar
111-
--echo # t1 yes on expecting NOT FOUND
112-
-- let SEARCH_FILE=$t1_IBD_1
113-
-- source include/search_pattern_in_file.inc
114-
--let SEARCH_PATTERN=temp
115-
--echo # t2 ... on expecting NOT FOUND
116-
-- let SEARCH_FILE=$t2_IBD_1
117-
-- source include/search_pattern_in_file.inc
118-
--echo # t3 ... on expecting NOT FOUND
119-
--let SEARCH_PATTERN=barfoo
120-
-- let SEARCH_FILE=$t3_IBD_1
121-
-- source include/search_pattern_in_file.inc
122-
123108
--echo # List after t1 DISCARD
124109
--list_files $MYSQLD_DATADIR/test
110+
--error 0,1,2
111+
--remove_file $MYSQLD_DATADIR/test/t1.cfg
112+
--error 0,1,2
113+
--remove_file $MYSQLD_DATADIR/test/t1.ibd
114+
--error 0,1,2
115+
--remove_file $MYSQLD_DATADIR/test/t2.cfg
116+
--error 0,1,2
117+
--remove_file $MYSQLD_DATADIR/test/t2.ibd
118+
--error 0,1,2
119+
--remove_file $MYSQLD_DATADIR/test/t3.cfg
120+
--error 0,1,2
121+
--remove_file $MYSQLD_DATADIR/test/t3.ibd
122+
--enable_result_log
123+
--echo # Restarting server
124+
-- source include/restart_mysqld.inc
125+
--echo # Done restarting server
126+
127+
SET GLOBAL innodb_file_format = `Barracuda`;
128+
SET GLOBAL innodb_file_per_table = ON;
125129

126-
--copy_file $MYSQLD_TMPDIR/t1.cfg $MYSQLD_DATADIR/test/t1.cfg
127-
--copy_file $MYSQLD_TMPDIR/t1.ibd $MYSQLD_DATADIR/test/t1.ibd
128-
--copy_file $MYSQLD_TMPDIR/t2.cfg $MYSQLD_DATADIR/test/t2.cfg
129-
--copy_file $MYSQLD_TMPDIR/t2.ibd $MYSQLD_DATADIR/test/t2.ibd
130-
--copy_file $MYSQLD_TMPDIR/t3.cfg $MYSQLD_DATADIR/test/t3.cfg
131-
--copy_file $MYSQLD_TMPDIR/t3.ibd $MYSQLD_DATADIR/test/t3.ibd
130+
--copy_file $MYSQLD_TMPDIR/t1$id.cfg $MYSQLD_DATADIR/test/t1.cfg
131+
--copy_file $MYSQLD_TMPDIR/t1$id.ibd $MYSQLD_DATADIR/test/t1.ibd
132+
--copy_file $MYSQLD_TMPDIR/t2$id.cfg $MYSQLD_DATADIR/test/t2.cfg
133+
--copy_file $MYSQLD_TMPDIR/t2$id.ibd $MYSQLD_DATADIR/test/t2.ibd
134+
--copy_file $MYSQLD_TMPDIR/t3$id.cfg $MYSQLD_DATADIR/test/t3.cfg
135+
--copy_file $MYSQLD_TMPDIR/t3$id.ibd $MYSQLD_DATADIR/test/t3.ibd
132136

133137
--sleep 5
134138
--echo # Tablespaces should be still encrypted
@@ -146,8 +150,11 @@ ALTER TABLE t3 DISCARD TABLESPACE;
146150
-- source include/search_pattern_in_file.inc
147151

148152
ALTER TABLE t1 IMPORT TABLESPACE;
153+
SELECT COUNT(1) FROM t1;
149154
ALTER TABLE t2 IMPORT TABLESPACE;
155+
SELECT COUNT(1) FROM t2;
150156
ALTER TABLE t3 IMPORT TABLESPACE;
157+
SELECT COUNT(1) FROM t3;
151158

152159
--sleep 5
153160
--echo # tablespaces should remain encrypted after import

0 commit comments

Comments
 (0)