| 
 | 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 | +--source include/restart_mysqld_no_echo.inc  | 
 | 29 | + | 
 | 30 | +--echo # Create a new 'unencrypted' table  | 
 | 31 | +CREATE TABLE t1 (id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,  | 
 | 32 | +                 C1 TEXT(500),  | 
 | 33 | +                 C2 VARCHAR(200),  | 
 | 34 | +                 C3 VARCHAR(200)) ENCRYPTION='N' ENGINE=InnoDB;  | 
 | 35 | + | 
 | 36 | +# Make sure all pages are flushed  | 
 | 37 | +set global innodb_buf_flush_list_now = 1;  | 
 | 38 | + | 
 | 39 | +--echo # ---------------------------------------------------------------  | 
 | 40 | +--echo # Test 1 : t1 un-encrypted, FTS tables should also be unencrypted  | 
 | 41 | +--echo # ---------------------------------------------------------------  | 
 | 42 | +--echo # Check that tablespace file is not encrypted  | 
 | 43 | +--let ts_name=test/t1.ibd  | 
 | 44 | +--source include/if_encrypted.inc  | 
 | 45 | + | 
 | 46 | +CREATE FULLTEXT INDEX idx ON t1(C1);  | 
 | 47 | + | 
 | 48 | +# Make sure all pages are flushed  | 
 | 49 | +set global innodb_buf_flush_list_now = 1;  | 
 | 50 | + | 
 | 51 | +--let ts_name = `select NAME from information_schema.innodb_tables where name like "%index_1%";`  | 
 | 52 | +--let ts_name = $ts_name.ibd  | 
 | 53 | +--echo # Check that FTS tablespaces file is not encrypted  | 
 | 54 | +--source include/if_encrypted.inc  | 
 | 55 | + | 
 | 56 | +--echo # ---------------------------------------------------------------  | 
 | 57 | +--echo # Test 1 : t1 encrypted, FTS tables should also be unencrypted  | 
 | 58 | +--echo # ---------------------------------------------------------------  | 
 | 59 | +# Now, change the encryption property of table  | 
 | 60 | +ALTER TABLE t1 ENCRYPTION='Y';  | 
 | 61 | + | 
 | 62 | +--echo # Check that tablespace file is encrypted now  | 
 | 63 | +--let ts_name=test/t1.ibd  | 
 | 64 | +--source include/if_encrypted.inc  | 
 | 65 | + | 
 | 66 | +--let ts_name = `select NAME from information_schema.innodb_tables where name like "%index_1%";`  | 
 | 67 | +--let ts_name = $ts_name.ibd  | 
 | 68 | +--echo # Check that FTS tablespace file is encrypted now  | 
 | 69 | +--source include/if_encrypted.inc  | 
 | 70 | + | 
 | 71 | +--echo ###########  | 
 | 72 | +--echo # CLEANUP #  | 
 | 73 | +--echo ###########  | 
 | 74 | +DROP TABLE test.t1;  | 
 | 75 | +remove_file $MYSQLTEST_VARDIR/tmpfile.txt;  | 
 | 76 | +remove_file $MYSQL_TMP_DIR/mysecret_keyring;  | 
 | 77 | + | 
 | 78 | +--echo # Restarting server without keyring to restore server state  | 
 | 79 | +let $restart_parameters = restart: ;  | 
 | 80 | +--source include/restart_mysqld.inc  | 
0 commit comments