| 1 |
-- source include/have_innodb.inc |
| 2 |
-- source include/have_example_key_management_plugin.inc |
| 3 |
-- source include/not_valgrind.inc |
| 4 |
-- source include/not_embedded.inc |
| 5 |
|
| 6 |
let MYSQLD_DATADIR = `SELECT @@datadir`; |
| 7 |
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd |
| 8 |
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES; |
| 9 |
INSERT INTO t1 VALUES(1, repeat('Nesamani', 10)); |
| 10 |
|
| 11 |
SELECT COUNT(*) FROM t1; |
| 12 |
SHOW CREATE TABLE t1; |
| 13 |
|
| 14 |
--echo # Wait max 10 min for key encryption threads to encrypt all spaces |
| 15 |
--let $wait_timeout= 600 |
| 16 |
--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND ROTATING_OR_FLUSHING <> 0 |
| 17 |
--source include/wait_condition.inc |
| 18 |
|
| 19 |
let $restart_noprint=2; |
| 20 |
--source include/restart_mysqld.inc |
| 21 |
let MYSQLD_DATADIR =`SELECT @@datadir`; |
| 22 |
|
| 23 |
--list_files $MYSQLD_DATADIR/test |
| 24 |
FLUSH TABLES t1 FOR EXPORT; |
| 25 |
perl; |
| 26 |
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; |
| 27 |
ib_backup_tablespaces("test", "t1"); |
| 28 |
EOF |
| 29 |
--list_files $MYSQLD_DATADIR/test |
| 30 |
UNLOCK TABLES; |
| 31 |
DROP TABLE t1; |
| 32 |
|
| 33 |
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES; |
| 34 |
ALTER TABLE t1 DISCARD TABLESPACE; |
| 35 |
perl; |
| 36 |
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; |
| 37 |
ib_discard_tablespaces("test", "t1"); |
| 38 |
ib_restore_tablespaces("test", "t1"); |
| 39 |
EOF |
| 40 |
|
| 41 |
ALTER TABLE t1 IMPORT TABLESPACE; |
| 42 |
|
| 43 |
SELECT COUNT(*) FROM t1; |
| 44 |
SHOW CREATE TABLE t1; |
| 45 |
DROP TABLE t1; |