summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorSatya Bodapati <satya.bodapati@oracle.com>2013-09-27 18:32:13 +0530
committerSatya Bodapati <satya.bodapati@oracle.com>2013-09-27 18:32:13 +0530
commit436fd04b02d9323b414d367c7fc070e0a9122eea (patch)
tree7096f8a3f43c22b3a25d24b6b7ae97463f5b4a14 /storage
parentd4011a614411e67633cc75a6233c74a22dd32ff5 (diff)
parent797a49f848f4c456a95be07781c493c710254b3a (diff)
downloadmariadb-git-436fd04b02d9323b414d367c7fc070e0a9122eea.tar.gz
Merge fix for BUG#17446090 from mysql-5.1 to mysql-5.5
The testcase for this bug fails randomly due to two reasons. 1. Due to ibuf merge happening background 2. Due to dict stats update which brings the evicted page back into buffer pool. Fix ibuf_contract_ext() to not do any merges with ibuf_debug enabled and also changed dict_stats_update() to return fake statistics without bringing the secondary index pages into buffer pool. Approved by Marko. rb#3419
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/dict/dict0dict.c11
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.c11
-rw-r--r--storage/innobase/include/dict0types.h5
-rw-r--r--storage/innobase/include/ibuf0ibuf.h5
4 files changed, 22 insertions, 10 deletions
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index c3f64046da0..1fe7000f718 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -36,6 +36,11 @@ UNIV_INTERN dict_index_t* dict_ind_redundant;
/** dummy index for ROW_FORMAT=COMPACT supremum and infimum records */
UNIV_INTERN dict_index_t* dict_ind_compact;
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/** Flag to control insert buffer debugging. */
+UNIV_INTERN uint ibuf_debug;
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
#ifndef UNIV_HOTBACKUP
#include "buf0buf.h"
#include "data0type.h"
@@ -4520,6 +4525,12 @@ dict_update_statistics(
continue;
}
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ if (ibuf_debug && !dict_index_is_clust(index)) {
+ goto fake_statistics;
+ }
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
if (UNIV_LIKELY
(srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE
|| (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
index 59403bc599c..d22fc8b9962 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.c
+++ b/storage/innobase/ibuf/ibuf0ibuf.c
@@ -193,11 +193,6 @@ access order rules. */
/** Operations that can currently be buffered. */
UNIV_INTERN ibuf_use_t ibuf_use = IBUF_USE_ALL;
-#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
-/** Flag to control insert buffer debugging. */
-UNIV_INTERN uint ibuf_debug;
-#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
-
/** The insert buffer control structure */
UNIV_INTERN ibuf_t* ibuf = NULL;
@@ -2649,6 +2644,12 @@ ibuf_contract_ext(
return(0);
}
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ if (ibuf_debug) {
+ return(0);
+ }
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
ibuf_mtr_start(&mtr);
/* Open a cursor to a randomly chosen leaf of the tree, at a random
diff --git a/storage/innobase/include/dict0types.h b/storage/innobase/include/dict0types.h
index 330e6a25114..22407e2408e 100644
--- a/storage/innobase/include/dict0types.h
+++ b/storage/innobase/include/dict0types.h
@@ -63,4 +63,9 @@ typedef enum dict_err_ignore dict_err_ignore_t;
#define TEMP_TABLE_PREFIX "#sql"
#define TEMP_TABLE_PATH_PREFIX "/" TEMP_TABLE_PREFIX
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/** Flag to control insert buffer debugging. */
+extern uint ibuf_debug;
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
#endif
diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h
index 7fa077d5c8f..b34d06ffde3 100644
--- a/storage/innobase/include/ibuf0ibuf.h
+++ b/storage/innobase/include/ibuf0ibuf.h
@@ -63,11 +63,6 @@ typedef enum {
/** Operations that can currently be buffered. */
extern ibuf_use_t ibuf_use;
-#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
-/** Flag to control insert buffer debugging. */
-extern uint ibuf_debug;
-#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
-
/** The insert buffer control structure */
extern ibuf_t* ibuf;