summaryrefslogtreecommitdiff
path: root/mysql-test/suite/encryption/t/compressed_import_tablespace.test
blob: e79fdb17f02a69eb99eee6f8bb7d2d0e0fc1dfbf (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
-- source include/have_innodb.inc
-- source include/have_example_key_management_plugin.inc
-- source include/not_valgrind.inc
-- source include/not_embedded.inc

let MYSQLD_DATADIR = `SELECT @@datadir`;
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES;
INSERT INTO t1 VALUES(1, repeat('Nesamani', 10));

SELECT COUNT(*) FROM t1;
SHOW CREATE TABLE t1;

--echo # Wait max 10 min for key encryption threads to encrypt all spaces
--let $wait_timeout= 600
--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND ROTATING_OR_FLUSHING <> 0
--source include/wait_condition.inc

let $restart_noprint=2;
--source include/restart_mysqld.inc
let MYSQLD_DATADIR =`SELECT @@datadir`;

--list_files $MYSQLD_DATADIR/test
FLUSH TABLES t1 FOR EXPORT;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
EOF
--list_files $MYSQLD_DATADIR/test
UNLOCK TABLES;
DROP TABLE t1;

CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES;
ALTER TABLE t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF

ALTER TABLE t1 IMPORT TABLESPACE;

SELECT COUNT(*) FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;