From 13af39824030a675bf2188d3870e56197ef13425 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 15 Aug 2011 23:53:55 +0300 Subject: [PATCH] Fixed recovery crash lp:814806 "Unclean shutdown corrupted Aria table blocking startup" storage/maria/ma_recovery.c: Moved trman_init() before parse_checkpoint_record() as this calls trnman functions if we have to open tables. --- storage/maria/ma_recovery.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c index 8752f70668c..4263b0131a9 100644 --- a/storage/maria/ma_recovery.c +++ b/storage/maria/ma_recovery.c @@ -320,25 +320,32 @@ int maria_apply_log(LSN from_lsn, LSN end_lsn, skip_DDLs= skip_DDLs_arg; skipped_undo_phase= 0; + trnman_init(max_trid_in_control_file); + if (from_lsn == LSN_IMPOSSIBLE) { if (last_checkpoint_lsn == LSN_IMPOSSIBLE) { from_lsn= translog_first_lsn_in_log(); if (unlikely(from_lsn == LSN_ERROR)) + { + trnman_destroy(); goto err; + } } else { from_lsn= parse_checkpoint_record(last_checkpoint_lsn); if (from_lsn == LSN_ERROR) + { + trnman_destroy(); goto err; + } } } now= my_getsystime(); in_redo_phase= TRUE; - trnman_init(max_trid_in_control_file); if (run_redo_phase(from_lsn, end_lsn, apply)) { ma_message_no_user(0, "Redo phase failed");