summaryrefslogtreecommitdiff
path: root/storage/innodb_plugin/ibuf
diff options
context:
space:
mode:
authorSatya B <satya.bn@sun.com>2009-11-30 17:02:05 +0530
committerSatya B <satya.bn@sun.com>2009-11-30 17:02:05 +0530
commita1092e9b66c47e4077e90c2b5aa9ec49b473dcd7 (patch)
treed8c13e0e1125bcb9d8aa029609425fc840349ce8 /storage/innodb_plugin/ibuf
parentcefd968dddcbd333fad186daeebeb17ef907d154 (diff)
downloadmariadb-git-a1092e9b66c47e4077e90c2b5aa9ec49b473dcd7.tar.gz
Applying InnoDB Plugin 1.0.6 snapshot,part 1. Fixes BUG#45992 and BUG#46656
Detailed revision comments: r6130 | marko | 2009-11-02 11:42:56 +0200 (Mon, 02 Nov 2009) | 9 lines branches/zip: Free all resources at shutdown. Set pointers to NULL, so that Valgrind will not complain about freed data structures that are reachable via pointers. This addresses Bug #45992 and Bug #46656. This patch is mostly based on changes copied from branches/embedded-1.0, mainly c5432, c3439, c3134, c2994, c2978, but also some other code was copied. Some added cleanup code is specific to MySQL/InnoDB. rb://199 approved by Sunny Bains
Diffstat (limited to 'storage/innodb_plugin/ibuf')
-rw-r--r--storage/innodb_plugin/ibuf/ibuf0ibuf.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/storage/innodb_plugin/ibuf/ibuf0ibuf.c b/storage/innodb_plugin/ibuf/ibuf0ibuf.c
index 37c68391477..08986fac0ef 100644
--- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c
+++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c
@@ -390,6 +390,27 @@ ibuf_count_set(
#endif
/******************************************************************//**
+Closes insert buffer and frees the data structures. */
+UNIV_INTERN
+void
+ibuf_close(void)
+/*============*/
+{
+ mutex_free(&ibuf_pessimistic_insert_mutex);
+ memset(&ibuf_pessimistic_insert_mutex,
+ 0x0, sizeof(ibuf_pessimistic_insert_mutex));
+
+ mutex_free(&ibuf_mutex);
+ memset(&ibuf_mutex, 0x0, sizeof(ibuf_mutex));
+
+ mutex_free(&ibuf_bitmap_mutex);
+ memset(&ibuf_bitmap_mutex, 0x0, sizeof(ibuf_mutex));
+
+ mem_free(ibuf);
+ ibuf = NULL;
+}
+
+/******************************************************************//**
Updates the size information of the ibuf, assuming the segment size has not
changed. */
static