Debian Codegraph @

mysql-test/suite/component_keyring_file/r/tablespace_encrypt_5.result

raw
1 # ----------------------------------------------------------------------
2 # Setup
3 # Creating local configuration file for keyring component: component_keyring_file
4 # Creating manifest file for current MySQL server instance
5 # Re-starting mysql server with manifest file
6 # ----------------------------------------------------------------------
7 #########
8 # SETUP #
9 #########
10
11 #########################################################################
12 # WITH KEYRING
13 #########################################################################
14 # Create a new 'unencrypted' tablespace 'encrypt_ts'
15 SELECT NAME, FLAG, SPACE_TYPE FROM information_schema.INNODB_TABLESPACES
16 where NAME="encrypt_ts";
17 NAME FLAG SPACE_TYPE
18 create tablespace encrypt_ts add datafile 'encrypt_ts.ibd'
19 engine=INNODB encryption='N';
20 SELECT NAME, FLAG, SPACE_TYPE FROM information_schema.INNODB_TABLESPACES
21 where NAME="encrypt_ts";
22 NAME FLAG SPACE_TYPE
23 encrypt_ts 18432 General
24 # Create a table test.t1 in 'encrypt_ts' tablespace and insert some records.
25 create table test.t1 (c char(20)) tablespace encrypt_ts;
26 insert into test.t1 values ("samplerecord");
27 set global innodb_buf_flush_list_now = 1;
28 #############################################################
29 # INITIAL SETUP : Tablespace is created as unencrypted #
30 # A table is created and rows are inserted #
31 #############################################################
32 # Check that tablespace file is not encrypted yet
33 # Print result
34 table space is Unencrypted.
35 ############################################################
36 # ALTER TABLESPACE 1 : Unencrypted => Encrypted #
37 ############################################################
38 ALTER TABLESPACE encrypt_ts ENCRYPTION='Y';
39 set global innodb_buf_flush_list_now = 1;
40 # Check that tablespace file is encrypted now
41 # Print result
42 table space is Encrypted.
43 ############################################################
44 # ALTER TABLESPACE 2 : Encrypted => Unencrypted #
45 ############################################################
46 ALTER TABLESPACE encrypt_ts ENCRYPTION='N';
47 set global innodb_buf_flush_list_now = 1;
48 # Check that tablespace file is not encrypted now
49 # Print result
50 table space is Unencrypted.
51
52 ################# CRASH/RECOVERY TESTING ###################
53
54 ############################################################
55 # ALTER TABLESPACE 3 : Unencrypted => Encrypted #
56 # (crash at page 10) #
57 ############################################################
58 SELECT COUNT(*) FROM test.t1;
59 COUNT(*)
60 4096
61 set global innodb_buf_flush_list_now = 1;
62 # Check that tablespace file is still unencrypted
63 # Print result
64 table space is Unencrypted.
65 # Set Encryption process to crash at page 10
66 SET SESSION debug= '+d,alter_encrypt_tablespace_page_10';
67 ALTER TABLESPACE encrypt_ts ENCRYPTION='Y';
68 # Wait for Encryption processing to finish in background thread
69 # After restart/recovery, check that Encryption was roll-forward and
70 # tablespace file is encrypted now
71 # Print result
72 table space is Encrypted.
73 ############################################################
74 # ALTER TABLESPACE 4 : Encrypted => Unencrypted #
75 # (crash at page 10) #
76 ############################################################
77 SELECT COUNT(*) FROM test.t1;
78 COUNT(*)
79 4096
80 # Check that tablespace file is Encrypted
81 # Print result
82 table space is Encrypted.
83 # Set Encryption process to crash after page 10
84 SET SESSION debug= '+d,alter_encrypt_tablespace_page_10';
85 ALTER TABLESPACE encrypt_ts ENCRYPTION='N';
86 # Wait for Unencryption processing to finish in background thread
87 # After restart/recovery, check that Unencryption was roll-forward and
88 # tablespace file is Unencrypted now
89 # Print result
90 table space is Unencrypted.
91 ###########
92 # CLEANUP #
93 ###########
94 DROP TABLE test.t1;
95 DROP TABLESPACE encrypt_ts;
96 # ----------------------------------------------------------------------
97 # Teardown
98 # Removing manifest file for current MySQL server instance
99 # Removing local keyring file for keyring component: component_keyring_file
100 # Removing local configuration file for keyring component: component_keyring_file
101 # Restarting server without the manifest file
102 # ----------------------------------------------------------------------