Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
# empty redo log from before 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-log-recovery-target=12345
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
FOUND 1 /InnoDB: cannot fulfill innodb_log_recovery_target=12345!=/ in mysqld.1.err
# 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=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
Expand Down
10 changes: 8 additions & 2 deletions mysql-test/suite/innodb/r/corrupted_during_recovery.result
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
CREATE TABLE t1(a BIGINT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t1(a BIGINT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
INSERT INTO t1 VALUES(1);
SET GLOBAL innodb_max_purge_lag_wait=0, innodb_log_checkpoint_now=ON;
CREATE TABLE t2(a BIGINT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(2);
SET GLOBAL innodb_flush_log_at_trx_commit=1;
INSERT INTO t2 VALUES(1);
# Kill the server
SELECT * FROM t2;
Got one of the listed errors
SELECT * FROM t2;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: impossible innodb_log_recovery_start=/ in mysqld.1.err
# Corrupt the pages
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Page \[page id: space=[1-9][0-9]*, page number=3\] log sequence number 1311768467463790320 is in the future!/ in mysqld.1.err
SELECT * FROM t1;
a
1
Expand All @@ -18,6 +23,7 @@ a
CHECK TABLE t2;
Table Op Msg_type Msg_text
test.t2 check status OK
FOUND 1 /InnoDB: Page \[page id: space=[1-9][0-9]*, page number=3\] log sequence number 1311768467463790320 is in the future!/ in mysqld.1.err
DROP TABLE t1, t2;
CREATE TABLE t1(pk SERIAL) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3);
Expand Down
25 changes: 23 additions & 2 deletions mysql-test/suite/innodb/r/innodb-wl5522,strict_crc32.rdiff
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
--- innodb-wl5522.result
+++ innodb-wl5522,strict_crc32.result~
@@ -131,8 +131,7 @@
@@ -1,9 +1,6 @@
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT\\.");
call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it");
call mtr.add_suppression("InnoDB: Cannot save statistics for table `test`\\.`t1` because the \\.ibd file is missing");
-call mtr.add_suppression("InnoDB: cannot fulfill innodb_log_recovery_target=123456<");
-call mtr.add_suppression("InnoDB: Plugin initialization aborted");
-call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed\\.");
FLUSH TABLES;
CREATE TABLE t1
(a INT AUTO_INCREMENT PRIMARY KEY,
@@ -37,10 +34,6 @@
t1.ibd
t2.frm
t2.ibd
-# restart: --innodb-log-recovery-target=123456
-FOUND 1 /InnoDB: cannot fulfill innodb_log_recovery_target=123456</ in mysqld.1.err
-FLUSH TABLE t1, t2 FOR EXPORT;
-ERROR 42000: Unknown storage engine 'InnoDB'
# restart
FLUSH TABLE t1, t2 FOR EXPORT;
# List before copying files
@@ -138,8 +131,7 @@
ALTER TABLE t2 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1; .cfg file uses ROW_FORMAT=COMPACT)
ALTER TABLE t2 IMPORT TABLESPACE;
-Warnings:
-Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
+ERROR HY000: Schema mismatch (Expected FSP_SPACE_FLAGS=0x*, .ibd file contains 0x*.)
DROP TABLE t2;
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
@@innodb_file_per_table
7 changes: 7 additions & 0 deletions mysql-test/suite/innodb/r/innodb-wl5522.result
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT\\.");
call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it");
call mtr.add_suppression("InnoDB: Cannot save statistics for table `test`\\.`t1` because the \\.ibd file is missing");
call mtr.add_suppression("InnoDB: cannot fulfill innodb_log_recovery_target=123456<");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed\\.");
FLUSH TABLES;
CREATE TABLE t1
(a INT AUTO_INCREMENT PRIMARY KEY,
Expand Down Expand Up @@ -34,6 +37,10 @@ t1.frm
t1.ibd
t2.frm
t2.ibd
# restart: --innodb-log-recovery-target=123456
FOUND 1 /InnoDB: cannot fulfill innodb_log_recovery_target=123456</ in mysqld.1.err
FLUSH TABLE t1, t2 FOR EXPORT;
ERROR 42000: Unknown storage engine 'InnoDB'
# restart
FLUSH TABLE t1, t2 FOR EXPORT;
# List before copying files
Expand Down
7 changes: 7 additions & 0 deletions mysql-test/suite/innodb/r/innodb_force_recovery.result
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ create table t2(f1 int primary key, f2 int, index idx(f2))engine=innodb;
insert into t1 values(1, 2);
insert into t2 values(1, 2);
SET GLOBAL innodb_fast_shutdown = 0;
# restart: --innodb-log-recovery-target=20480
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
FOUND 1 /InnoDB: cannot fulfill innodb_log_recovery_target=20480</ in mysqld.1.err
# restart: --innodb-force-recovery=4
select variable_name,variable_value from information_schema.global_status
WHERE variable_name LIKE 'innodb_buffer_pool_%_requests';
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/innodb/r/innodb_status_variables.result
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ INNODB_LOG_WRITES
INNODB_LSN_CURRENT
INNODB_LSN_FLUSHED
INNODB_LSN_LAST_CHECKPOINT
INNODB_LSN_ARCHIVED
INNODB_MASTER_THREAD_ACTIVE_LOOPS
INNODB_MASTER_THREAD_IDLE_LOOPS
INNODB_MAX_TRX_ID
Expand Down
7 changes: 7 additions & 0 deletions mysql-test/suite/innodb/r/log_corruption.result
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
# empty redo log from before 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-log-recovery-target=12345
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
FOUND 1 /InnoDB: cannot fulfill innodb_log_recovery_target=12345!=/ in mysqld.1.err
# 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=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
Expand Down
16 changes: 15 additions & 1 deletion mysql-test/suite/innodb/r/log_file_size_online.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SET GLOBAL innodb_log_archive=OFF;
SET GLOBAL innodb_log_file_size=4194304;
SHOW VARIABLES LIKE 'innodb_log_file_size';
Variable_name Value
Expand All @@ -11,7 +12,7 @@ a INT PRIMARY KEY AUTO_INCREMENT,
b CHAR(255) NOT NULL)
ENGINE=INNODB;
INSERT INTO t SELECT NULL, REPEAT('a', 255) FROM seq_1_to_20000;
# restart: --innodb-log-file-size=4194304
# restart: --innodb-log-file-size=4194304 --skip-innodb-log-archive
SELECT COUNT(*) FROM t;
COUNT(*)
20000
Expand All @@ -28,8 +29,18 @@ Got one of the listed errors
connect con1,localhost,root;
SET GLOBAL innodb_log_file_size=7340032;
connection default;
SET GLOBAL innodb_log_archive=ON;
ERROR HY000: SET GLOBAL innodb_log_file_size is in progress
SELECT @@GLOBAL.innodb_log_archive;
@@GLOBAL.innodb_log_archive
0
KILL QUERY @id;
connection con1;
SET GLOBAL innodb_log_archive=ON, innodb_log_file_size=10485760;
SELECT @@GLOBAL.innodb_log_file_size!=10485760;
@@GLOBAL.innodb_log_file_size!=10485760
1
SET GLOBAL innodb_log_archive=OFF;
connection default;
SET GLOBAL innodb_log_file_size=5242880;
connection con1;
Expand All @@ -46,6 +57,8 @@ connection con1;
disconnect con1;
connection default;
# restart
SET @save_archive=@@GLOBAL.innodb_log_archive;
SET GLOBAL innodb_log_archive=OFF;
SELECT * FROM t WHERE a<10;
a b
1
Expand Down Expand Up @@ -73,4 +86,5 @@ SHOW VARIABLES LIKE 'innodb_log_file_size';
Variable_name Value
innodb_log_file_size 5242880
FOUND 1 /InnoDB: Resized log to 6\.000MiB/ in mysqld.1.err
SET GLOBAL innodb_log_archive=@save_archive;
DROP TABLE t;
10 changes: 10 additions & 0 deletions mysql-test/suite/innodb/r/rename_table.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
call mtr.add_suppression("InnoDB: In RENAME TABLE table `test`.`t4` is referenced in foreign key constraints which are not compatible with the new table definition.");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("InnoDB: cannot fulfill innodb_log_recovery_target=20480<");
CREATE DATABASE test_jfg;
CREATE DATABASE test_jfg2;
CREATE TABLE test_jfg.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB;
Expand All @@ -8,6 +11,13 @@ FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE filename LIKE '%test%';
path
./test_jfg2/test.ibd
DROP DATABASE test_jfg;
# restart: --innodb-log-recovery-target=20480
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
FOUND 1 /InnoDB: cannot fulfill innodb_log_recovery_target=20480</ in mysqld.1.err
# restart
DROP DATABASE test_jfg2;
CREATE DATABASE abc_def;
Expand Down
34 changes: 28 additions & 6 deletions mysql-test/suite/innodb/t/corrupted_during_recovery.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,47 @@ call mtr.add_suppression("InnoDB: Page \\[page id: space=[1-9][0-9]*, page numbe
call mtr.add_suppression("InnoDB: Your database may be corrupt");
call mtr.add_suppression("InnoDB: MySQL-8\\.0 tablespace in .*test/t2\\.ibd");
call mtr.add_suppression("InnoDB: Restart in MySQL for migration/recovery\\.");
call mtr.add_suppression("InnoDB: impossible innodb_log_recovery_start=");
call mtr.add_suppression("InnoDB: cannot fulfill innodb_log_recovery_target=");
--enable_query_log

let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
let ALGO=`select @@innodb_checksum_algorithm`;
CREATE TABLE t1(a BIGINT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t1(a BIGINT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
INSERT INTO t1 VALUES(1);
# Force a redo log checkpoint.
let $restart_noprint=2;
--source include/restart_mysqld.inc
SET GLOBAL innodb_max_purge_lag_wait=0, innodb_log_checkpoint_now=ON;
--source ../include/no_checkpoint_start.inc
let $checkpoint=`SELECT variable_value FROM information_schema.global_status
WHERE variable_name='innodb_lsn_last_checkpoint'`;
let $before=`SELECT variable_value FROM information_schema.global_status
WHERE variable_name='innodb_lsn_current'`;

CREATE TABLE t2(a BIGINT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(2);
SET GLOBAL innodb_flush_log_at_trx_commit=1;
let $after=`SELECT variable_value FROM information_schema.global_status
WHERE variable_name='innodb_lsn_current'`;
INSERT INTO t2 VALUES(1);

--let CLEANUP_IF_CHECKPOINT=DROP TABLE t1,t2;
--source ../include/no_checkpoint_end.inc

--let $restart_parameters=--innodb-log-recovery-target=$before
--source include/start_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE,ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t2;
--let $restart_parameters=--innodb-log-recovery-target=$after --innodb-log-recovery-start=$before
--source include/restart_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t2;
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN=InnoDB: impossible innodb_log_recovery_start=;
--source include/search_pattern_in_file.inc
--source include/shutdown_mysqld.inc
--let $restart_parameters=--innodb-log-recovery-target=$after --innodb-log-recovery-start=$checkpoint

--echo # Corrupt the pages

perl;
Expand Down Expand Up @@ -75,10 +98,6 @@ EOF
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;

let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN=InnoDB: Page \\[page id: space=[1-9][0-9]*, page number=3\\] log sequence number 1311768467463790320 is in the future!;
--source include/search_pattern_in_file.inc

let $restart_parameters=--innodb_force_recovery=1;
--source include/restart_mysqld.inc

Expand All @@ -87,6 +106,9 @@ SELECT * FROM t1;
SELECT * FROM t2;
CHECK TABLE t2;

let SEARCH_PATTERN=InnoDB: Page \\[page id: space=[1-9][0-9]*, page number=3\\] log sequence number 1311768467463790320 is in the future!;
--source include/search_pattern_in_file.inc

DROP TABLE t1, t2;

# MDEV-21572 buf_page_get_gen() should apply buffered page
Expand Down
2 changes: 0 additions & 2 deletions mysql-test/suite/innodb/t/innodb-master.opt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
--default-storage-engine=MyISAM
--innodb-strict-mode=0
--innodb-file-per-table=0
--loose-innodb-track-changed-pages
--loose-innodb-log-archive
18 changes: 17 additions & 1 deletion mysql-test/suite/innodb/t/innodb-wl5522.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT\\.");
call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it");
call mtr.add_suppression("InnoDB: Cannot save statistics for table `test`\\.`t1` because the \\.ibd file is missing");

if ($MTR_COMBINATION_STRICT_FULL_CRC32) {
call mtr.add_suppression("InnoDB: cannot fulfill innodb_log_recovery_target=123456<");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed\\.");
}
FLUSH TABLES;

let $MYSQLD_DATADIR = `SELECT @@datadir`;
Expand Down Expand Up @@ -36,6 +40,18 @@ SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;

--list_files $MYSQLD_DATADIR/test
if ($MTR_COMBINATION_STRICT_FULL_CRC32) {
--let $restart_parameters=--innodb-log-recovery-target=123456
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_PATTERN= InnoDB: cannot fulfill innodb_log_recovery_target=123456<
--source include/search_pattern_in_file.inc
--error ER_UNKNOWN_STORAGE_ENGINE
FLUSH TABLE t1, t2 FOR EXPORT;
--let $restart_parameters=
--let $shutdown_timeout=
}
--source include/restart_mysqld.inc
FLUSH TABLE t1, t2 FOR EXPORT;
--echo # List before copying files
Expand Down
13 changes: 13 additions & 0 deletions mysql-test/suite/innodb/t/innodb_force_recovery.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
call mtr.add_suppression("InnoDB: Failed to find tablespace for table .* in the cache. Attempting to load the tablespace with space id");
call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for test.t[12], old maximum was");
call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for mysql.transaction_registry, old maximum was");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("InnoDB: cannot fulfill innodb_log_recovery_target=20480<");
--enable_query_log

create table t1(f1 int not null, f2 int not null, index idx(f2))engine=innodb;
Expand All @@ -17,6 +20,16 @@ insert into t2 values(1, 2);

SET GLOBAL innodb_fast_shutdown = 0;

--let $restart_parameters= --innodb-log-recovery-target=20480
--source include/restart_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');

--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_PATTERN= InnoDB: cannot fulfill innodb_log_recovery_target=20480<
--source include/search_pattern_in_file.inc

--let $restart_parameters= --innodb-force-recovery=4
--source include/restart_mysqld.inc
let $status=`SHOW ENGINE INNODB STATUS`;
Expand Down
11 changes: 10 additions & 1 deletion mysql-test/suite/innodb/t/log_corruption.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ call mtr.add_suppression("InnoDB: Obtaining redo log encryption key version 1 fa
call mtr.add_suppression("InnoDB: Decrypting checkpoint failed");
call mtr.add_suppression("InnoDB: Log file .*ib_logfile1 is of different size 2097152 bytes than other log files (1048576|4194304) bytes!");
call mtr.add_suppression("InnoDB: The change buffer is corrupted");
call mtr.add_suppression("InnoDB: cannot fulfill innodb_log_recovery_target=12345!=");
--enable_query_log

let bugdir= $MYSQLTEST_VARDIR/tmp/log_corruption;
Expand Down Expand Up @@ -171,11 +172,19 @@ die unless seek(OUT, 0x800, 0);
print OUT pack("NnnNx[496]N", 0x80000944, 12, 12, 0, 0xb2a);
close OUT or die;
EOF
--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m
--let $restart_parameters= $dirs --innodb-log-recovery-target=12345
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--let SEARCH_PATTERN= InnoDB: cannot fulfill innodb_log_recovery_target=12345!=
--source include/search_pattern_in_file.inc

--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m
--source include/restart_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
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/innodb/t/log_file_size_online.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--skip-innodb-log-archive
Loading