Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
N/A
-
None
Description
I'm almost certain that it's not a real problem, since innodb.leaf_page_corrupted_during_recovery is a rather low-level and internals-specific test. Still, better to double-check, to ensure that we don't have some well-hidden issue upon recovery which might be not easy to reveal otherwise.
diff --git a/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test b/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
|
index 92c3e2fbb08..f3ee93192ff 100644
|
--- a/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
|
+++ b/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
|
@@ -11,7 +11,7 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: We detected index corruption");
|
call mtr.add_suppression("\\[ERROR\\] (mysqld|mariadbd).*: Index for table 't1' is corrupt; try to repair it");
|
call mtr.add_suppression("InnoDB: btr_pcur_open_low level: 0 table: `test`\\.`t1` index: `PRIMARY`");
|
--enable_query_log
|
-CREATE TABLE t1 (pk INT PRIMARY KEY, c CHAR(255))ENGINE=InnoDB STATS_PERSISTENT=0;
|
+CREATE TABLE t1 (pk INT, PRIMARY KEY (pk DESC), c CHAR(255))ENGINE=InnoDB STATS_PERSISTENT=0;
|
|
SET GLOBAL INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG = 2;
|
|
preview-10.8-MDEV-13756-desc-indexes c10e10c693 with the test modified as above |
innodb.leaf_page_corrupted_during_recovery 'innodb,strict_crc32' [ fail ]
|
Test ended at 2022-01-22 16:57:20
|
|
CURRENT_TEST: innodb.leaf_page_corrupted_during_recovery
|
mysqltest: At line 48: query 'SELECT * FROM t1 WHERE PK = 1' failed with wrong errno ER_TABLE_CORRUPT (1877): 'Table test/t1 is corrupted. Please drop the table and recreate.', instead of ER_UNKNOWN_STORAGE_ENGINE (1286)...
|
So, if I get the difference correctly from the error log, in the "normal" execution the corruption is detected upon recovery, InnoDB reports it once and the plugin initialization aborts, while with the modified execution it starts up and only reveals corruption at a later stage.
Attachments
Issue Links
- relates to
-
MDEV-13756 Implement descending index: KEY (a DESC, b ASC)
-
- Closed
-
Is this really a bug? The test is corrupting a page 19 of the tablespace and then expecting things to fail in a particular way.
My guess is that 19 used to be the first leaf page to be visited by the SELECT statement, and now it is some other page.
The test passes (only produces a result mismatch) if I reverse the keys on insert, update, and select. Note: the UPDATE had better not change the length of the column.
diff --git a/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test b/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
index 92c3e2fbb08..df685804d22 100644
--- a/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
+++ b/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
@@ -11,14 +11,15 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: We detected index corruption");
call mtr.add_suppression("\\[ERROR\\] (mysqld|mariadbd).*: Index for table 't1' is corrupt; try to repair it");
call mtr.add_suppression("InnoDB: btr_pcur_open_low level: 0 table: `test`\\.`t1` index: `PRIMARY`");
--enable_query_log
-CREATE TABLE t1 (pk INT PRIMARY KEY, c CHAR(255))ENGINE=InnoDB STATS_PERSISTENT=0;
+CREATE TABLE t1 (pk INT, PRIMARY KEY (pk DESC), c CHAR(255))ENGINE=InnoDB STATS_PERSISTENT=0;
SET GLOBAL INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG = 2;
-INSERT INTO t1 VALUES(1, 'sql'), (2, 'server'), (3, 'mariadb'),
- (4, 'mariadb'), (5, 'test1'), (6, 'test2'), (7, 'test3'),
- (8, 'test4'), (9, 'test5'), (10, 'test6'), (11, 'test7'),
- (12, 'test8');
+INSERT INTO t1 VALUES
+(12, 'test8'), (11, 'test7'), (10, 'test6'),
+(9, 'test5'), (8, 'test4'), (7, 'test3'),
+(6, 'test2'), (5, 'test1'), (4, 'mariadb'),
+(3, 'mariadb'), (2, 'server'), (1, 'sql');
let $restart_noprint=2;
--source include/restart_mysqld.inc
@@ -28,7 +29,7 @@ let MYSQLD_DATADIR=`select @@datadir`;
SELECT COUNT(*) FROM t1;
--source ../include/no_checkpoint_start.inc
-UPDATE t1 SET c='best8' WHERE pk=12;
+UPDATE t1 SET c='qsl' WHERE pk=1;
--let CLEANUP_IF_CHECKPOINT=DROP TABLE t1;
--source ../include/no_checkpoint_end.inc
@@ -49,9 +50,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;
+SELECT * FROM t1 WHERE PK = 12;
--error ER_NOT_KEYFILE
-SELECT * FROM t1 WHERE pk = 12;
+SELECT * FROM t1 WHERE pk = 1;
DROP TABLE t1;