summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-06-20 14:37:37 +0300
committerMichael Widenius <monty@askmonty.org>2012-06-20 14:37:37 +0300
commit4f703fe70ba65056971cfcce979fc3407f921288 (patch)
tree9abeee9402f9f85778f031ac14cd44ba538553e7 /storage
parent0b93b444b6c4de6b219fd3a4b3d5fa2e388dc211 (diff)
downloadmariadb-git-4f703fe70ba65056971cfcce979fc3407f921288.tar.gz
Fixed MDEV-348: 5.5 valgrind warinings on maria tests
Diffstat (limited to 'storage')
-rw-r--r--storage/maria/ma_close.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/storage/maria/ma_close.c b/storage/maria/ma_close.c
index d1b90dc826e..c355f1f1def 100644
--- a/storage/maria/ma_close.c
+++ b/storage/maria/ma_close.c
@@ -193,23 +193,29 @@ int maria_close(register MARIA_HA *info)
else
share_can_be_freed= TRUE;
- if (share->state_history && share->state_history->trid)
+ if (share->state_history)
{
- MARIA_STATE_HISTORY_CLOSED *history;
- DBUG_PRINT("info", ("Storing state history"));
- /*
- Here we ignore the unlikely case that we don't have memory to
- store the state. In the worst case what happens is that any transaction
- that tries to access this table will get a wrong status information.
- */
- if ((history= (MARIA_STATE_HISTORY_CLOSED *)
- my_malloc(sizeof(*history), MYF(MY_WME))))
+ if (share->state_history->trid) /* If not visible for all */
{
- history->create_rename_lsn= share->state.create_rename_lsn;
- history->state_history= share->state_history;
- if (my_hash_insert(&maria_stored_state, (uchar*) history))
- my_free(history);
+ MARIA_STATE_HISTORY_CLOSED *history;
+ DBUG_PRINT("info", ("Storing state history"));
+ /*
+ Here we ignore the unlikely case that we don't have memory
+ to store the state. In the worst case what happens is that
+ any transaction that tries to access this table will get a
+ wrong status information.
+ */
+ if ((history= (MARIA_STATE_HISTORY_CLOSED *)
+ my_malloc(sizeof(*history), MYF(MY_WME))))
+ {
+ history->create_rename_lsn= share->state.create_rename_lsn;
+ history->state_history= share->state_history;
+ if (my_hash_insert(&maria_stored_state, (uchar*) history))
+ my_free(history);
+ }
}
+ else
+ my_free(share->state_history);
/* Marker for concurrent checkpoint */
share->state_history= 0;
}