From c437506826630d962bafd1e9468eeb6147d03708 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 5 Mar 2012 21:59:00 +0200 Subject: [PATCH] Ensure that we mark all processed tables as 'properly closed'. This is needed as last log entry may be a DDL that is not processed and then a table may be left in 'not properly closed state' even if information is correct in it. --- storage/maria/ma_recovery.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c index 37def17c4c3..77091c4747b 100644 --- a/storage/maria/ma_recovery.c +++ b/storage/maria/ma_recovery.c @@ -665,11 +665,13 @@ prototype_redo_exec_hook_dummy(INCOMPLETE_GROUP) prototype_redo_exec_hook(INCOMPLETE_LOG) { MARIA_HA *info; + if (skip_DDLs) { tprint(tracef, "we skip DDLs\n"); return 0; } + if ((info= get_MARIA_HA_from_REDO_record(rec)) == NULL) { /* no such table, don't need to warn */ @@ -1479,7 +1481,13 @@ end: if (error) { if (info != NULL) + { + /* let maria_close() mark the table properly closed */ + info->s->state.open_count= 1; + info->s->global_changed= 1; + info->s->changed= 1; maria_close(info); + } if (error == -1) error= 0; }