summaryrefslogtreecommitdiff
path: root/mysql-test/suite/maria/t/maria-recovery3.test
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2009-01-16 22:00:39 +0100
committerGuilhem Bichot <guilhem@mysql.com>2009-01-16 22:00:39 +0100
commit3907cb1d70861cd57d7a36d03796fc43d9e77239 (patch)
tree9df7c6f3b85f2dbe6b7f22b111376a162f320275 /mysql-test/suite/maria/t/maria-recovery3.test
parenta955efc40c965dd8b19a18b2eef439d9166bb132 (diff)
downloadmariadb-git-3907cb1d70861cd57d7a36d03796fc43d9e77239.tar.gz
Fix for BUG#42112 "Maria: recovery failure (pushbuild2) Assertion `rownr == 0 && new_page' failed"
mysql-test/suite/maria/r/maria-recovery3.result: result update mysql-test/suite/maria/t/maria-recovery3.test: Test for BUG#42112; before the bugfix, recovery would assert like this: ma_blockrec.c:6051: _ma_apply_redo_insert_row_head_or_tail: Assertion `rownr == 0 && new_page' failed. storage/maria/ma_create.c: Fix for BUG#42112; plus some intentional crashes to test the fix. The bug was that if crash happened during TRUNCATE TABLE, in maria_create(), after the index file's state has been written but before its LSNs have been updated (so, if crash happened between _ma_state_info_write_sub() and _ma_update_state__lsns_sub()), then that would leave a table with create_rename_lsn==0. Recovery would then try old pre-TRUNCATE REDOs on this table, and fail as this table is already partly shortened. Fix is to write create_rename_lsn==LSN_MAX as soon as TRUNCATE touches the index file, so that Recovery ignores this table. This allows Maria to start; the table is still corrupted but the user can successfully repeat TRUNCATE TABLE (which required Maria to start). storage/maria/ma_delete_all.c: A comment.
Diffstat (limited to 'mysql-test/suite/maria/t/maria-recovery3.test')
-rw-r--r--mysql-test/suite/maria/t/maria-recovery3.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/suite/maria/t/maria-recovery3.test b/mysql-test/suite/maria/t/maria-recovery3.test
index baee7978f2b..fc1883b1aa7 100644
--- a/mysql-test/suite/maria/t/maria-recovery3.test
+++ b/mysql-test/suite/maria/t/maria-recovery3.test
@@ -88,6 +88,28 @@ check table t1 extended;
-- source include/maria_verify_recovery.inc
drop table t1;
+# Test for BUG#42112 "Maria: recovery failure (pushbuild2) Assertion
+# `rownr == 0 && new_page' failed"
+
+let $mvr_restore_old_snapshot=0;
+let $mms_compare_physically=0;
+create table t1 engine=maria select 1;
+-- source include/maria_make_snapshot_for_feeding_recovery.inc
+set global maria_checkpoint_interval=0; # no checkpoints
+insert into t1 values(2);
+truncate table t1;
+-- source include/maria_make_snapshot_for_comparison.inc
+let $mvr_crash_statement= truncate table t1;
+let $mvr_debug_option="+d,maria_flush_whole_log,maria_crash_create_table";
+truncate table t1;
+-- source include/maria_verify_recovery.inc
+# Table is bad but at least Recovery didn't crash and a new truncate
+# can succeed:
+truncate table t1;
+check table t1 extended;
+drop table t1;
+
+
# clean up everything
let $mms_purpose=comparison;
eval drop database mysqltest_for_$mms_purpose;