4
4
-- source include/not_embedded.inc
5
5
-- source include/not_windows.inc
6
6
7
+ call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded.");
8
+
7
9
--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
8
10
--let $MYSQLD_DATADIR = `SELECT @@datadir`
9
11
--let SEARCH_RANGE = 10000000
12
+ --let $id = `SELECT RAND()`
10
13
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
11
14
--let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd
12
15
--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
16
16
17
17
--disable_query_log
18
18
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
@@ -84,12 +84,12 @@ FLUSH TABLE t1, t2, t3 FOR EXPORT;
84
84
--error 0,1,2
85
85
--remove_file $MYSQLD_TMPDIR/t3.ibd
86
86
--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
93
93
UNLOCK TABLES;
94
94
95
95
--echo # Restarting server
@@ -105,30 +105,34 @@ ALTER TABLE t1 DISCARD TABLESPACE;
105
105
ALTER TABLE t2 DISCARD TABLESPACE;
106
106
ALTER TABLE t3 DISCARD TABLESPACE;
107
107
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
-
123
108
--echo # List after t1 DISCARD
124
109
--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;
125
129
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
132
136
133
137
--sleep 5
134
138
--echo # Tablespaces should be still encrypted
@@ -146,8 +150,11 @@ ALTER TABLE t3 DISCARD TABLESPACE;
146
150
-- source include/search_pattern_in_file.inc
147
151
148
152
ALTER TABLE t1 IMPORT TABLESPACE;
153
+ SELECT COUNT(1) FROM t1;
149
154
ALTER TABLE t2 IMPORT TABLESPACE;
155
+ SELECT COUNT(1) FROM t2;
150
156
ALTER TABLE t3 IMPORT TABLESPACE;
157
+ SELECT COUNT(1) FROM t3;
151
158
152
159
--sleep 5
153
160
--echo # tablespaces should remain encrypted after import
0 commit comments