| 
 | 1 | +--echo #  | 
 | 2 | +--echo # Bug#30787535 : FULLTEXT INDEX TABLES CREATED IN ENCRYPTED SCHEMA ARE NOT ENCRYPTED  | 
 | 3 | +--echo #  | 
 | 4 | + | 
 | 5 | +################################################################################  | 
 | 6 | +# For an encrypted table, this test case checks physical ibd file for :  | 
 | 7 | +#	- table  | 
 | 8 | +#	- fts table created for an FTS index on table  | 
 | 9 | +#	- Other aux tables created for FTS index  | 
 | 10 | +#  to see if they are encrypted.  | 
 | 11 | +################################################################################  | 
 | 12 | +# Disable in valgrind because of timeout, cf. Bug#22760145  | 
 | 13 | +--source include/not_valgrind.inc  | 
 | 14 | +# Waiting time when (re)starting the server  | 
 | 15 | +--let $explicit_default_wait_counter=10000;  | 
 | 16 | + | 
 | 17 | +--echo #########  | 
 | 18 | +--echo # SETUP #  | 
 | 19 | +--echo #########  | 
 | 20 | +--echo  | 
 | 21 | +let datadir=`SELECT @@datadir`;  | 
 | 22 | +let search_pattern=supremum;  | 
 | 23 | + | 
 | 24 | +--echo #########################################################################  | 
 | 25 | +--echo # RESTART 1 : WITH KEYRING PLUGIN  | 
 | 26 | +--echo #########################################################################  | 
 | 27 | +let $restart_parameters = restart: --early-plugin-load=keyring_file=$KEYRING_PLUGIN --loose-keyring_file_data=$MYSQL_TMP_DIR/mysecret_keyring $KEYRING_PLUGIN_OPT;  | 
 | 28 | +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR $KEYRING_PLUGIN_OPT --plugin-dir=KEYRING_PLUGIN_PATH $KEYRING_PLUGIN keyring_file.so  | 
 | 29 | +--replace_regex /\.dll/.so/  | 
 | 30 | +--source include/restart_mysqld.inc  | 
 | 31 | + | 
 | 32 | +--echo # Create a new 'unencrypted' table  | 
 | 33 | +CREATE TABLE t1 (id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,  | 
 | 34 | +                 C1 TEXT(500),  | 
 | 35 | +                 C2 VARCHAR(200),  | 
 | 36 | +                 C3 VARCHAR(200)) ENCRYPTION='N' ENGINE=InnoDB;  | 
 | 37 | + | 
 | 38 | +# Make sure all pages are flushed  | 
 | 39 | +set global innodb_buf_flush_list_now = 1;  | 
 | 40 | + | 
 | 41 | +--echo # ---------------------------------------------------------------  | 
 | 42 | +--echo # Test 1 : t1 un-encrypted, FTS tables should also be unencrypted  | 
 | 43 | +--echo # ---------------------------------------------------------------  | 
 | 44 | +--echo # Check that tablespace file is not encrypted  | 
 | 45 | +--let ts_name=test/t1.ibd  | 
 | 46 | +--source include/if_encrypted.inc  | 
 | 47 | + | 
 | 48 | +CREATE FULLTEXT INDEX idx ON t1(C1);  | 
 | 49 | + | 
 | 50 | +# Make sure all pages are flushed  | 
 | 51 | +set global innodb_buf_flush_list_now = 1;  | 
 | 52 | + | 
 | 53 | +--let ts_name = `select NAME from information_schema.innodb_sys_tables where name like "%INDEX_1%";`  | 
 | 54 | +--let ts_name = $ts_name.ibd  | 
 | 55 | +--echo # Check that FTS tablespaces file is not encrypted  | 
 | 56 | +--source include/if_encrypted.inc  | 
 | 57 | + | 
 | 58 | +--echo # ---------------------------------------------------------------  | 
 | 59 | +--echo # Test 1 : t1 encrypted, FTS tables should also be unencrypted  | 
 | 60 | +--echo # ---------------------------------------------------------------  | 
 | 61 | +# Now, change the encryption property of table  | 
 | 62 | +ALTER TABLE t1 ENCRYPTION='Y';  | 
 | 63 | + | 
 | 64 | +--echo # Check that tablespace file is encrypted now  | 
 | 65 | +--let ts_name=test/t1.ibd  | 
 | 66 | +--source include/if_encrypted.inc  | 
 | 67 | + | 
 | 68 | +--let ts_name = `select NAME from information_schema.innodb_sys_tables where name like "%INDEX_1%";`  | 
 | 69 | +--let ts_name = $ts_name.ibd  | 
 | 70 | +--echo # Check that FTS tablespace file is encrypted now  | 
 | 71 | +--source include/if_encrypted.inc  | 
 | 72 | + | 
 | 73 | +--echo ###########  | 
 | 74 | +--echo # CLEANUP #  | 
 | 75 | +--echo ###########  | 
 | 76 | +DROP TABLE test.t1;  | 
 | 77 | +remove_file $MYSQLTEST_VARDIR/tmpfile.txt;  | 
 | 78 | +remove_file $MYSQL_TMP_DIR/mysecret_keyring;  | 
 | 79 | + | 
 | 80 | +--echo # Restarting server without keyring to restore server state  | 
 | 81 | +let $restart_parameters = restart: ;  | 
 | 82 | +--source include/restart_mysqld.inc  | 
0 commit comments