mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
MDEV-19541: Avoid infinite loop of reading a corrupted page
row_search_mvcc(): Duplicate the logic of btr_pcur_move_to_next() so that an infinite loop can be avoided when advancing to the next page fails due to a corrupted page.
This commit is contained in:
@@ -7,6 +7,8 @@ call mtr.add_suppression("InnoDB: Background Page read failed to read or decrypt
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to read file '.*test.t1\\.ibd' at offset 19: Page read from tablespace is corrupted\\.");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: Plugin initialization aborted at srv0start\\.cc.* with error Data structure corruption");
|
||||
call mtr.add_suppression("\\[ERROR\\] Plugin 'InnoDB' (init function|registration)");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: We detected index corruption");
|
||||
call mtr.add_suppression("\\[ERROR\\] mysqld: Index for table 't1' is corrupt; try to repair it");
|
||||
--enable_query_log
|
||||
CREATE TABLE t1 (pk INT PRIMARY KEY, c CHAR(255))ENGINE=InnoDB STATS_PERSISTENT=0;
|
||||
|
||||
@@ -19,13 +21,15 @@ INSERT INTO t1 VALUES(1, 'sql'), (2, 'server'), (3, 'mariadb'),
|
||||
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
SELECT COUNT(*) FROM t1;
|
||||
UPDATE t1 SET c='best8' WHERE pk=12;
|
||||
|
||||
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
|
||||
let MYSQLD_DATADIR=`select @@datadir`;
|
||||
|
||||
--source include/kill_mysqld.inc
|
||||
SELECT COUNT(*) FROM t1;
|
||||
--source ../include/no_checkpoint_start.inc
|
||||
UPDATE t1 SET c='best8' WHERE pk=12;
|
||||
|
||||
--let CLEANUP_IF_CHECKPOINT=DROP TABLE t1;
|
||||
--source ../include/no_checkpoint_end.inc
|
||||
--echo # Corrupt the pages
|
||||
|
||||
perl;
|
||||
@@ -44,7 +48,9 @@ SELECT * FROM t1 WHERE PK = 1;
|
||||
let $restart_parameters=--innodb-force-recovery=1;
|
||||
--source include/restart_mysqld.inc
|
||||
SELECT * FROM t1 WHERE PK = 1;
|
||||
--error ER_GET_ERRMSG
|
||||
--error ER_NOT_KEYFILE
|
||||
SELECT * FROM t1 WHERE pk = 12;
|
||||
|
||||
DROP TABLE t1;
|
||||
let $restart_parameters=;
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
Reference in New Issue
Block a user