Browse Source
MDEV-17228 Encrypted temporary tables are not encrypted
MDEV-17228 Encrypted temporary tables are not encrypted
- Introduce a new variable called innodb_encrypt_temporary_tables which is a boolean variable. It decides whether to encrypt the temporary tablespace. - Encrypts the temporary tablespace based on full checksum format. - Introduced a new counter to track encrypted and decrypted temporary tablespace pages. - Warnings issued if temporary table creation has conflict value with innodb_encrypt_temporary_tables - Added a new test case which reads and writes the pages from/to temporary tablespace.bb-10.2-MDEV-19746
19 changed files with 280 additions and 72 deletions
-
1mysql-test/suite/encryption/r/debug_key_management.result
-
2mysql-test/suite/encryption/r/innodb_encrypt_log.result
-
19mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result
-
2mysql-test/suite/encryption/r/innodb_encryption.result
-
2mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.opt
-
23mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test
-
14mysql-test/suite/sys_vars/r/sysvars_innodb.result
-
149storage/innobase/buf/buf0buf.cc
-
14storage/innobase/buf/buf0dblwr.cc
-
28storage/innobase/handler/ha_innodb.cc
-
19storage/innobase/ibuf/ibuf0ibuf.cc
-
6storage/innobase/include/buf0buf.h
-
8storage/innobase/include/log0crypt.h
-
15storage/innobase/include/srv0srv.h
-
20storage/innobase/log/log0crypt.cc
-
9storage/innobase/row/row0log.cc
-
4storage/innobase/row/row0merge.cc
-
9storage/innobase/srv/srv0srv.cc
-
8storage/innobase/srv/srv0start.cc
@ -0,0 +1,19 @@ |
|||
SELECT variable_value into @old_encrypted FROM information_schema.global_status |
|||
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted'; |
|||
SELECT variable_value into @old_decrypted FROM information_schema.global_status |
|||
WHERE variable_name = 'innodb_encryption_n_temp_blocks_decrypted'; |
|||
CREATE TEMPORARY TABLE t1(f1 CHAR(200), f2 CHAR(200)) ENGINE=InnoDB; |
|||
INSERT INTO t1 (f1,f2) SELECT '', '' FROM seq_1_to_8192; |
|||
CREATE TEMPORARY TABLE t2(f1 CHAR(100), f2 CHAR(200), f3 CHAR(200))ENGINE=InnoDB; |
|||
INSERT INTO t2 (f1,f2,f3) SELECT '', '', '' FROM seq_1_to_8192; |
|||
SELECT COUNT(*) FROM t1; |
|||
COUNT(*) |
|||
8192 |
|||
SELECT variable_value > @old_encrypted FROM information_schema.global_status |
|||
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted'; |
|||
variable_value > @old_encrypted |
|||
1 |
|||
SELECT variable_value > @old_decrypted FROM information_schema.global_status |
|||
WHERE variable_name = 'innodb_encryption_n_temp_blocks_decrypted'; |
|||
variable_value > @old_decrypted |
|||
1 |
|||
@ -0,0 +1,2 @@ |
|||
--innodb_buffer_pool_size=5M |
|||
--innodb_encrypt_temporary_tables=1 |
|||
@ -0,0 +1,23 @@ |
|||
--source include/have_sequence.inc |
|||
--source include/have_innodb.inc |
|||
--source include/have_file_key_management_plugin.inc |
|||
|
|||
SELECT variable_value into @old_encrypted FROM information_schema.global_status |
|||
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted'; |
|||
|
|||
SELECT variable_value into @old_decrypted FROM information_schema.global_status |
|||
WHERE variable_name = 'innodb_encryption_n_temp_blocks_decrypted'; |
|||
|
|||
CREATE TEMPORARY TABLE t1(f1 CHAR(200), f2 CHAR(200)) ENGINE=InnoDB; |
|||
INSERT INTO t1 (f1,f2) SELECT '', '' FROM seq_1_to_8192; |
|||
|
|||
CREATE TEMPORARY TABLE t2(f1 CHAR(100), f2 CHAR(200), f3 CHAR(200))ENGINE=InnoDB; |
|||
INSERT INTO t2 (f1,f2,f3) SELECT '', '', '' FROM seq_1_to_8192; |
|||
|
|||
SELECT COUNT(*) FROM t1; |
|||
SELECT variable_value > @old_encrypted FROM information_schema.global_status |
|||
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted'; |
|||
|
|||
SELECT variable_value > @old_decrypted FROM information_schema.global_status |
|||
WHERE variable_name = 'innodb_encryption_n_temp_blocks_decrypted'; |
|||
--source include/restart_mysqld.inc |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue