| 1 |
# InnoDB transparent tablespace data encryption |
| 2 |
# This test case will test portability of encrypted table support features. |
| 3 |
# This test try to port an encrypted table which created by 32bits server to 64bits server. |
| 4 |
# The data files of source table is in mysql-test/std_data/table_encrypted_32.zip. |
| 5 |
# For update the table_encrypted_32.zip, you have to run the test case table_encrypt_portable_32 in |
| 6 |
# record mode. |
| 7 |
|
| 8 |
--source include/have_innodb_16k.inc |
| 9 |
--source include/have_debug.inc |
| 10 |
--source include/have_64bit.inc |
| 11 |
--source include/not_windows.inc |
| 12 |
|
| 13 |
######################### |
| 14 |
# how to record test result for 32bit test case table_encrypt_portable_32 content mismatch |
| 15 |
# Run the test with --record option. |
| 16 |
######################### |
| 17 |
|
| 18 |
let $MYSQLD_DATADIR = `SELECT @@datadir`; |
| 19 |
|
| 20 |
let $source_db = test; |
| 21 |
|
| 22 |
let $dest_db = test; |
| 23 |
|
| 24 |
if ($MTR_RECORD == 1) { |
| 25 |
# Create a table with encryption |
| 26 |
--disable_query_log |
| 27 |
CREATE TABLE t1(c1 INT, c2 char(20)) ENCRYPTION="Y" ENGINE = InnoDB; |
| 28 |
INSERT INTO t1 VALUES(0, "aaaaa"); |
| 29 |
INSERT INTO t1 VALUES(1, "bbbbb"); |
| 30 |
INSERT INTO t1 VALUES(2, "ccccc"); |
| 31 |
INSERT INTO t1 VALUES(3, "ddddd"); |
| 32 |
INSERT INTO t1 VALUES(4, "eeeee"); |
| 33 |
INSERT INTO t1 VALUES(5, "fffff"); |
| 34 |
INSERT INTO t1 VALUES(6, "ggggg"); |
| 35 |
INSERT INTO t1 VALUES(7, "hhhhh"); |
| 36 |
INSERT INTO t1 VALUES(8, "iiiii"); |
| 37 |
INSERT INTO t1 VALUES(9, "jjjjj"); |
| 38 |
INSERT INTO t1 select * from t1; |
| 39 |
INSERT INTO t1 select * from t1; |
| 40 |
|
| 41 |
eval FLUSH TABLES $source_db.t1 FOR EXPORT; |
| 42 |
|
| 43 |
--exec zip -j $MYSQL_TMP_DIR/table_encrypted.zip $MYSQLD_DATADIR/$source_db/t1.* 2>&1 > /dev/null |
| 44 |
--move_file $MYSQL_TMP_DIR/table_encrypted.zip $MYSQL_TEST_DIR/std_data/table_encrypted_64.zip |
| 45 |
|
| 46 |
UNLOCK TABLES; |
| 47 |
|
| 48 |
DROP TABLE t1; |
| 49 |
--enable_query_log |
| 50 |
} |
| 51 |
|
| 52 |
CREATE TABLE t1(c1 INT, c2 char(20)) ENCRYPTION="Y" ENGINE = InnoDB; |
| 53 |
eval ALTER TABLE $dest_db.t1 DISCARD TABLESPACE; |
| 54 |
|
| 55 |
--exec unzip -qo $MYSQL_TEST_DIR/std_data/table_encrypted_32.zip -d $MYSQLD_DATADIR/$dest_db |
| 56 |
|
| 57 |
eval ALTER TABLE $dest_db.t1 IMPORT TABLESPACE; |
| 58 |
|
| 59 |
SELECT * FROM t1; |
| 60 |
|
| 61 |
# Cleanup |
| 62 |
DROP TABLE t1; |
| 63 |
|