diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2022-11-29 17:19:30 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2022-11-29 19:49:53 +0530 |
commit | bb29712b450525ba9e956033387361830361932f (patch) | |
tree | 43aaf4c420e45d51a380563f9640e0d8d246b8ec /mysql-test/suite/encryption | |
parent | c1de3776a6c6e7bbb170d336cdbc6023cdd28645 (diff) | |
download | mariadb-git-bb29712b450525ba9e956033387361830361932f.tar.gz |
MDEV-30119 INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION.NAME is NULL for undo tablespaces
- Information_schema.innodb_tablespaces_encryption should print
undo tablespace name as innodb_undo001, innodb_undo002 and soon.
- Encryption test should include undo tablespaces count when
the tests are waiting for the condition to check whether all
tables are encrypted or decrypted.
Diffstat (limited to 'mysql-test/suite/encryption')
10 files changed, 198 insertions, 12 deletions
diff --git a/mysql-test/suite/encryption/r/encrypt_and_grep,undo3.rdiff b/mysql-test/suite/encryption/r/encrypt_and_grep,undo3.rdiff new file mode 100644 index 00000000000..210c2a61a17 --- /dev/null +++ b/mysql-test/suite/encryption/r/encrypt_and_grep,undo3.rdiff @@ -0,0 +1,32 @@ +--- encrypt_and_grep.result 2022-09-02 22:36:21.669650278 +0530 ++++ encrypt_and_grep.reject 2022-11-29 19:01:22.080027528 +0530 +@@ -14,6 +14,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -35,6 +38,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -62,6 +68,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry diff --git a/mysql-test/suite/encryption/r/innodb-remove-encryption,undo3.rdiff b/mysql-test/suite/encryption/r/innodb-remove-encryption,undo3.rdiff new file mode 100644 index 00000000000..421c962bd2e --- /dev/null +++ b/mysql-test/suite/encryption/r/innodb-remove-encryption,undo3.rdiff @@ -0,0 +1,32 @@ +--- innodb-remove-encryption.result 2022-09-02 20:44:59.960430396 +0530 ++++ innodb-remove-encryption,undo3.reject 2022-11-29 19:02:24.813094277 +0530 +@@ -13,6 +13,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -24,6 +27,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -36,6 +42,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_freed,undo3.rdiff b/mysql-test/suite/encryption/r/innodb_encrypt_freed,undo3.rdiff new file mode 100644 index 00000000000..36eea901a6e --- /dev/null +++ b/mysql-test/suite/encryption/r/innodb_encrypt_freed,undo3.rdiff @@ -0,0 +1,62 @@ +--- innodb_encrypt_freed.result 2021-03-23 15:44:14.466377983 +0530 ++++ innodb_encrypt_freed,undo3.reject 2022-11-29 19:04:24.987010571 +0530 +@@ -14,6 +14,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -29,6 +32,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -40,6 +46,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -55,6 +64,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -70,6 +82,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -87,6 +102,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_key_rotation_age,undo3.rdiff b/mysql-test/suite/encryption/r/innodb_encrypt_key_rotation_age,undo3.rdiff new file mode 100644 index 00000000000..476b0b3f213 --- /dev/null +++ b/mysql-test/suite/encryption/r/innodb_encrypt_key_rotation_age,undo3.rdiff @@ -0,0 +1,52 @@ +--- innodb_encrypt_key_rotation_age.result 2022-06-02 16:15:08.395122720 +0530 ++++ innodb_encrypt_key_rotation_age,undo3.reject 2022-11-29 19:06:07.964542115 +0530 +@@ -12,6 +12,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -27,6 +30,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -39,6 +45,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -59,6 +68,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry +@@ -71,6 +83,9 @@ + SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + NAME + innodb_system ++innodb_undo001 ++innodb_undo002 ++innodb_undo003 + mysql/innodb_index_stats + mysql/innodb_table_stats + mysql/transaction_registry diff --git a/mysql-test/suite/encryption/t/debug_key_management.test b/mysql-test/suite/encryption/t/debug_key_management.test index 15a560d4c42..45a93040d73 100644 --- a/mysql-test/suite/encryption/t/debug_key_management.test +++ b/mysql-test/suite/encryption/t/debug_key_management.test @@ -1,5 +1,6 @@ -- source include/have_innodb.inc -- source include/have_debug.inc +-- source include/innodb_undo_tablespaces.inc -- source include/not_embedded.inc if (`select count(*) = 0 from information_schema.plugins @@ -13,7 +14,7 @@ create table t1(a serial) engine=innoDB; set global innodb_encrypt_tables=ON; show variables like 'innodb_encrypt%'; ---let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + 1 + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` let $wait_condition= select count(*) = $tables_count from information_schema.innodb_tablespaces_encryption where current_key_version=1; --source include/wait_condition.inc diff --git a/mysql-test/suite/encryption/t/encrypt_and_grep.test b/mysql-test/suite/encryption/t/encrypt_and_grep.test index 03f67db83f9..687f14e8a55 100644 --- a/mysql-test/suite/encryption/t/encrypt_and_grep.test +++ b/mysql-test/suite/encryption/t/encrypt_and_grep.test @@ -1,4 +1,5 @@ -- source include/have_innodb.inc +-- source include/innodb_undo_tablespaces.inc -- source include/have_file_key_management_plugin.inc # @@ -59,7 +60,8 @@ SET GLOBAL innodb_encrypt_tables = off; --echo # Wait max 10 min for key encryption threads to decrypt all spaces --let $wait_timeout= 600 ---let $tables_count= `select count(*) from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` + --let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND CURRENT_KEY_VERSION = 0; --source include/wait_condition.inc diff --git a/mysql-test/suite/encryption/t/innodb-remove-encryption.test b/mysql-test/suite/encryption/t/innodb-remove-encryption.test index 1982616aec2..8ff5fd632fd 100644 --- a/mysql-test/suite/encryption/t/innodb-remove-encryption.test +++ b/mysql-test/suite/encryption/t/innodb-remove-encryption.test @@ -2,6 +2,7 @@ # Test uses restart --source include/not_embedded.inc --source filekeys_plugin.inc +--source include/innodb_undo_tablespaces.inc # # MDEV-15566: System tablespace does not easily key rotate to unencrypted @@ -23,7 +24,7 @@ create table t1(a int not null primary key, b char(200)) engine=innodb; --echo # Wait until encryption threads have encrypted all tablespaces ---let $tables_count= `select count(*) from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` --let $wait_timeout= 600 --let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND ROTATING_OR_FLUSHING = 0; --source include/wait_condition.inc diff --git a/mysql-test/suite/encryption/t/innodb_encrypt_freed.test b/mysql-test/suite/encryption/t/innodb_encrypt_freed.test index 785b4e9e498..7ba0b5a2d1a 100644 --- a/mysql-test/suite/encryption/t/innodb_encrypt_freed.test +++ b/mysql-test/suite/encryption/t/innodb_encrypt_freed.test @@ -2,6 +2,7 @@ --source include/have_example_key_management_plugin.inc --source include/have_debug.inc --source include/not_embedded.inc +--source include/innodb_undo_tablespaces.inc SHOW VARIABLES LIKE 'innodb_encrypt%'; @@ -10,7 +11,7 @@ SET GLOBAL innodb_encrypt_tables = ON; CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, f3 int not null, index(f1), index idx_1(f2), index(f2, f3)) ENGINE=InnoDB; ---let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + 1 + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` --echo # Wait max 10 min for key encryption threads to encrypt all spaces --let $wait_timeout= 600 @@ -30,12 +31,12 @@ insert into t2 values(1); connection default; ---let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + 1 + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` set global innodb_encrypt_tables = OFF; --echo # Wait max 10 min for key encryption threads to decrypt all spaces --let $wait_timeout= 600 ---let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 --source include/wait_condition.inc --sorted_result SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; @@ -63,7 +64,7 @@ drop table t1, t2; CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, f3 int not null, index(f1), index idx_1(f2), index(f2, f3)) ENGINE=InnoDB; ---let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + 1 + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` --echo # Wait max 10 min for key encryption threads to encrypt all spaces --let $wait_timeout= 600 @@ -82,7 +83,7 @@ insert into t2 values(1); connection default; ---let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + 1 + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` set global innodb_encrypt_tables = OFF; --echo # Wait max 10 min for key encryption threads to decrypt all spaces diff --git a/mysql-test/suite/encryption/t/innodb_encrypt_key_rotation_age.test b/mysql-test/suite/encryption/t/innodb_encrypt_key_rotation_age.test index ef38560c469..c96d33aa1af 100644 --- a/mysql-test/suite/encryption/t/innodb_encrypt_key_rotation_age.test +++ b/mysql-test/suite/encryption/t/innodb_encrypt_key_rotation_age.test @@ -1,6 +1,7 @@ -- source include/have_innodb.inc -- source include/not_embedded.inc -- source include/have_example_key_management_plugin.inc +-- source include/innodb_undo_tablespaces.inc CREATE TABLE t1 (f1 INT, f2 VARCHAR(256))engine=innodb; INSERT INTO t1 VALUES(1, 'MariaDB'), (2, 'Robot'), (3, 'Science'); @@ -20,7 +21,7 @@ let $restart_parameters= --innodb_encryption_threads=5 --innodb_encryption_rotat --echo # Wait until encryption threads have encrypted all tablespaces ---let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + 1 + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` --let $wait_timeout= 600 --let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; --source include/wait_condition.inc @@ -39,7 +40,7 @@ create table t4 (f1 int not null)engine=innodb encrypted=NO; --echo # Wait until encryption threads have encrypted all tablespaces ---let $tables_count= `select count(*) from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` --let $wait_timeout= 600 --let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; --source include/wait_condition.inc @@ -54,7 +55,7 @@ set global innodb_encrypt_tables = OFF; --echo # Wait until encryption threads to decrypt all unencrypted tablespaces ---let $tables_count= `select count(*) from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` --let $wait_timeout= 600 --let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND ROTATING_OR_FLUSHING = 0; --source include/wait_condition.inc @@ -69,7 +70,7 @@ set global innodb_encrypt_tables = ON; --echo # Wait until encryption threads to encrypt all unencrypted tablespaces ---let $tables_count= `select count(*) from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'` --let $wait_timeout= 600 --let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; --source include/wait_condition.inc diff --git a/mysql-test/suite/encryption/t/innodb_first_page.test b/mysql-test/suite/encryption/t/innodb_first_page.test index 7f2f915d010..db4d8eb3b16 100644 --- a/mysql-test/suite/encryption/t/innodb_first_page.test +++ b/mysql-test/suite/encryption/t/innodb_first_page.test @@ -4,12 +4,14 @@ --source include/have_innodb.inc --source include/have_file_key_management_plugin.inc +--source include/innodb_undo_tablespaces.inc let $datadir=`select @@datadir`; --source include/shutdown_mysqld.inc --remove_file $datadir/ib_logfile0 --remove_file $datadir/ibdata1 +--remove_files_wildcard $datadir undo* --source include/start_mysqld.inc |