diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-11-30 12:09:01 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-11-30 12:09:01 +0200 |
commit | b7ae4d442aa32752798f1d3b6122c35c4ebe2d07 (patch) | |
tree | 8389a43f1db8c01fbc016e07208b111bee428177 /mysql-test | |
parent | f124d71ab75e0d449eb80fb909fa3b0ac4b191a8 (diff) | |
parent | 4783f37cf79150db55a7258683e50a04d987af1d (diff) | |
download | mariadb-git-b7ae4d442aa32752798f1d3b6122c35c4ebe2d07.tar.gz |
Merge 10.6 into 10.7
Diffstat (limited to 'mysql-test')
15 files changed, 336 insertions, 66 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/r/innodb_encrypt_log_corruption.result b/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result index 7563100babb..8d1eb447b03 100644 --- a/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result +++ b/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result @@ -69,14 +69,6 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED'); COUNT(*) 1 FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err -# Empty large multi-file redo log from after MariaDB 10.2.2 -# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m -SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES -WHERE engine = 'innodb' -AND support IN ('YES', 'DEFAULT', 'ENABLED'); -COUNT(*) -1 -FOUND 4 /InnoDB: Upgrading redo log:/ in mysqld.1.err # redo log from "after" MariaDB 10.2.2, but with invalid header checksum # restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption SELECT * FROM INFORMATION_SCHEMA.ENGINES @@ -187,7 +179,7 @@ WHERE engine = 'innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED'); COUNT(*) 1 -FOUND 6 /InnoDB: Upgrading redo log:/ in mysqld.1.err +FOUND 5 /InnoDB: Upgrading redo log:/ in mysqld.1.err # Minimal MariaDB 10.1.21 encrypted redo log # restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' 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 diff --git a/mysql-test/suite/innodb/r/log_corruption.result b/mysql-test/suite/innodb/r/log_corruption.result index 890e3296164..bf92f77d30c 100644 --- a/mysql-test/suite/innodb/r/log_corruption.result +++ b/mysql-test/suite/innodb/r/log_corruption.result @@ -69,14 +69,6 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED'); COUNT(*) 1 FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err -# Empty large multi-file redo log from after MariaDB 10.2.2 -# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m -SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES -WHERE engine = 'innodb' -AND support IN ('YES', 'DEFAULT', 'ENABLED'); -COUNT(*) -1 -FOUND 4 /InnoDB: Upgrading redo log:/ in mysqld.1.err # redo log from "after" MariaDB 10.2.2, but with invalid header checksum # restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption SELECT * FROM INFORMATION_SCHEMA.ENGINES @@ -187,7 +179,7 @@ WHERE engine = 'innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED'); COUNT(*) 1 -FOUND 6 /InnoDB: Upgrading redo log:/ in mysqld.1.err +FOUND 5 /InnoDB: Upgrading redo log:/ in mysqld.1.err # Minimal MariaDB 10.1.21 encrypted redo log # restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 SELECT * FROM INFORMATION_SCHEMA.ENGINES diff --git a/mysql-test/suite/innodb/r/log_upgrade.result b/mysql-test/suite/innodb/r/log_upgrade.result new file mode 100644 index 00000000000..4da83460f93 --- /dev/null +++ b/mysql-test/suite/innodb/r/log_upgrade.result @@ -0,0 +1,16 @@ +call mtr.add_suppression("InnoDB: The change buffer is corrupted"); +# +# MDEV-24412 InnoDB: Upgrade after a crash is not supported +# +# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-force-recovery=5 --innodb-log-file-size=4m +SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES +WHERE engine = 'innodb' +AND support IN ('YES', 'DEFAULT', 'ENABLED'); +COUNT(*) +1 +FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err +ib_buffer_pool +ib_logfile0 +ibdata1 +# restart +# End of 10.5 tests diff --git a/mysql-test/suite/innodb/t/log_corruption.test b/mysql-test/suite/innodb/t/log_corruption.test index b8487e4262b..6730ec9a3a2 100644 --- a/mysql-test/suite/innodb/t/log_corruption.test +++ b/mysql-test/suite/innodb/t/log_corruption.test @@ -298,42 +298,6 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED'); --source include/search_pattern_in_file.inc --let $restart_parameters= $dirs ---echo # Empty large multi-file redo log from after MariaDB 10.2.2 -perl; -do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl"; -my $polynomial = 0x82f63b78; # CRC-32C - -die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0"; -binmode OUT; -$_= pack("Nx[5]nx[5]", 1, 0x1286) . "BogoDB 4.3.2.1" . chr(0) x 478; -print OUT $_, pack("N", mycrc32($_, 0, $polynomial)); -# checkpoint page 1 and all-zero checkpoint 2 -$_= pack("x[13]nCNNx[484]", 0x1286, 12, 2, 0x80c); -print OUT $_, pack("N", mycrc32($_, 0, $polynomial)); -print OUT chr(0) x 1024; -die unless seek(OUT, 0x1FFFFFFFF, 0); -print OUT chr(0); -close OUT or die; -die unless open OUT, ">", "$ENV{bugdir}/ib_logfile1"; -binmode OUT; -die unless seek(OUT, 0x800, 0); # the first 2048 bytes are unused! -$_= pack("Nnnx[500]", 0x80000944, 12, 12); -print OUT $_, pack("N", mycrc32($_, 0, $polynomial)); -die unless seek(OUT, 0x1FFFFFFFF, 0); -print OUT chr(0); -close OUT or die; -EOF - ---let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=2m ---source include/start_mysqld.inc -SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES -WHERE engine = 'innodb' -AND support IN ('YES', 'DEFAULT', 'ENABLED'); ---source include/shutdown_mysqld.inc ---let SEARCH_PATTERN= InnoDB: Upgrading redo log: ---source include/search_pattern_in_file.inc ---let $restart_parameters= $dirs - --remove_file $bugdir/ib_logfile0 --move_file $bugdir/ib_logfile $bugdir/ib_logfile0 diff --git a/mysql-test/suite/innodb/t/log_upgrade.test b/mysql-test/suite/innodb/t/log_upgrade.test new file mode 100644 index 00000000000..faf88c41bef --- /dev/null +++ b/mysql-test/suite/innodb/t/log_upgrade.test @@ -0,0 +1,120 @@ +--source include/have_innodb.inc +--source include/have_innodb_16k.inc +# Some operating systems or file systems do not support sparse files. +# For example, tmpfs on FreeBSD does not support them. +# On Microsoft Windows, sparse files have to be created in a special way. +--source include/big_test.inc +# include/shutdown_mysqld.inc does not work in ./mtr --embedded +--source include/not_embedded.inc + +call mtr.add_suppression("InnoDB: The change buffer is corrupted"); + +--source include/shutdown_mysqld.inc + +let bugdir= $MYSQLTEST_VARDIR/tmp/log_upgrade; +--mkdir $bugdir +--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err + +--let $dirs= --innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir + +--echo # +--echo # MDEV-24412 InnoDB: Upgrade after a crash is not supported +--echo # + +perl; +do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl"; +my $polynomial = 0x82f63b78; # CRC-32C + +# Create a dummy system tablespace file using the default innodb_page_size=16k +die unless open OUT, ">", "$ENV{bugdir}/ibdata1"; +binmode OUT; + +# We calculate innodb_checksum_algorithm=crc32 for the pages. +# The following bytes are excluded: +# bytes 0..3 (the checksum is stored there) +# bytes 26..37 (encryption key version, post-encryption checksum, tablespace id) +# bytes $page_size-8..$page_size-1 (checksum, LSB of FIL_PAGE_LSN) + +# Tablespace header page with valid FSP_SIZE=768 pages. +# Also, write a dummy FSEG_MAGIC_N at offset 60 to keep fseg_inode_try_get() +# happy when fseg_n_reserved_pages() is following an invalid pointer +# from the all-zero change buffer header page (page 3). +## FIL_PAGE_OFFSET +my $head = pack("Nx[18]", 0); +## FSP_PAGE_SIZE, # FSEG_MAGIC_N +my $body = pack("x[8]Nx[10]Nx[16312]", 768, 97937874); +my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial); +print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck); +# Dummy pages 1..6. +print OUT chr(0) x (6 * 16384); +# Dictionary header page (page 7). +## FIL_PAGE_OFFSET +$head = pack("Nx[18]", 7); +## DICT_HDR_TABLES,DICT_HDR_INDEXES +$body = pack("x[32]Nx[8]Nx[16290]", 8, 9); +$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial); +print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck); + +# Empty SYS_TABLES page (page 8). +## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT, FIL_PAGE_TYPE +$head = pack("NNNx[8]n", 8, ~0, ~0, 17855); +## PAGE_N_DIR_SLOTS, PAGE_HEAP_TOP, PAGE_INDEX_ID == DICT_TABLES_ID +$body = pack("nnx[31]Cx[20]", 2, 124, 1); +$body .= pack("nxnn", 0x801, 3, 116) . "infimum"; +$body .= pack("xnxnxx", 0x901, 0x803) . "supremum"; +$body .= pack("x[16248]nn", 116, 101); +$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial); +print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck); + +# Empty SYS_INDEXES page (page 9). +## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT, FIL_PAGE_TYPE +$head = pack("NNNx[8]n", 9, ~0, ~0, 17855); +## PAGE_N_DIR_SLOTS, PAGE_HEAP_TOP, PAGE_INDEX_ID == DICT_INDEXES_ID +$body = pack("nnx[31]Cx[20]", 2, 124, 3); +$body .= pack("nxnn", 0x801, 3, 116) . "infimum"; +$body .= pack("xnxnxx", 0x901, 0x803) . "supremum"; +$body .= pack("x[16248]nn", 116, 101); +$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial); +print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck); + +die unless seek(OUT, 768 * 16384 - 1, 0); +print OUT chr(0); +close OUT or die; + +die unless open OUT, ">", "$ENV{bugdir}/ib_logfile0"; +binmode OUT; +$_= pack("Nx[5]nx[5]", 1, 0x1286) . "BogoDB 4.3.2.1" . chr(0) x 478; +print OUT $_, pack("N", mycrc32($_, 0, $polynomial)); +# checkpoint page 1 and all-zero checkpoint 2 +$_= pack("x[13]nCNNx[484]", 0x1286, 12, 2, 0x80c); +print OUT $_, pack("N", mycrc32($_, 0, $polynomial)); +die unless seek(OUT, 0x1FFFFFFFF, 0); +print OUT chr(0); +close OUT or die; +die unless open OUT, ">", "$ENV{bugdir}/ib_logfile1"; +binmode OUT; +die unless seek(OUT, 0x800, 0); # the first 2048 bytes are unused! +$_= pack("Nnnx[500]", 0x80000944, 12, 12); +print OUT $_, pack("N", mycrc32($_, 0, $polynomial)); +die unless seek(OUT, 0x1FFFFFFFF, 0); +print OUT chr(0); +close OUT or die; +EOF + +--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m +--source include/start_mysqld.inc +SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES +WHERE engine = 'innodb' +AND support IN ('YES', 'DEFAULT', 'ENABLED'); +--source include/shutdown_mysqld.inc +--let SEARCH_PATTERN= InnoDB: Upgrading redo log: +--source include/search_pattern_in_file.inc +--let $restart_parameters= $dirs + +--list_files $bugdir +--remove_files_wildcard $bugdir +--rmdir $bugdir +--let $restart_parameters= +--source include/start_mysqld.inc + +--echo # End of 10.5 tests |