polardbxengine/mysql-test/suite/innodb/r/tablespace_encrypt_9.result

75 lines
2.5 KiB
Plaintext

#########################################################################
# START : WITHOUT KEYRING PLUGIN
#########################################################################
#########
# SETUP #
#########
CREATE TABLESPACE encrypt_ts ADD DATAFILE 'encrypt_ts.ibd' ENGINE=InnoDB ENCRYPTION="N";
CREATE TABLE t1(c1 char(100)) ENGINE=InnoDB TABLESPACE encrypt_ts;
set global innodb_buf_flush_list_now = 1;
SELECT NAME, ENCRYPTION FROM INFORMATION_SCHEMA.INNODB_TABLESPACES WHERE NAME='encrypt_ts';
NAME ENCRYPTION
encrypt_ts N
SELECT * FROM t1 LIMIT 10;
c1
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
ALTER TABLESPACE encrypt_ts ENCRYPTION='Y';
ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring plugin is loaded and initialized successfully.
#############################################################
# TEST 1 : CRASH DURING ALTER ENCRYPT A TABLESPACE.
#############################################################
#########################################################################
# RESTART 1 : WITH KEYRING PLUGIN
#########################################################################
############################################################
# ALTER TABLESPACE 1 : Unencrypted => Encrypted #
# (crash at page 10) #
############################################################
# Set Encryption process to crash at page 10
SET SESSION debug= '+d,alter_encrypt_tablespace_page_10';
SET GLOBAL innodb_log_checkpoint_now = ON;
SET GLOBAL innodb_page_cleaner_disabled_debug = 1;
SET GLOBAL innodb_dict_stats_disabled_debug = 1;
SET GLOBAL innodb_master_thread_disabled_debug = 1;
# Encrypt the tablespace. It will cause crash.
ALTER TABLESPACE encrypt_ts ENCRYPTION='Y';
# Restart after crash without Keyring plugin loaded
Pattern "CORRUPT LOG RECORD FOUND" found
# Server shouldn't have restarted, so query should fail.
SELECT * from test.t1 limit 10;
ERROR HY000: MySQL server has gone away
#########################################################################
# RESTART 2 : WITH KEYRING PLUGIN
#########################################################################
# Server should have restarted properly.
SELECT * from test.t1 limit 10;
c1
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
SOME VALUES
###########
# Cleanup #
###########
DROP TABLE t1;
DROP TABLESPACE encrypt_ts;
# Restarting server without keyring to restore server state
# restart: