Commit 57df886c authored by Satya Bodapati's avatar Satya Bodapati

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
parents 2ccb5370 84484d29
...@@ -36,6 +36,11 @@ UNIV_INTERN dict_index_t* dict_ind_redundant; ...@@ -36,6 +36,11 @@ UNIV_INTERN dict_index_t* dict_ind_redundant;
/** dummy index for ROW_FORMAT=COMPACT supremum and infimum records */ /** dummy index for ROW_FORMAT=COMPACT supremum and infimum records */
UNIV_INTERN dict_index_t* dict_ind_compact; 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 #ifndef UNIV_HOTBACKUP
#include "buf0buf.h" #include "buf0buf.h"
#include "data0type.h" #include "data0type.h"
...@@ -4520,6 +4525,12 @@ dict_update_statistics( ...@@ -4520,6 +4525,12 @@ dict_update_statistics(
continue; 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 if (UNIV_LIKELY
(srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE
|| (srv_force_recovery < SRV_FORCE_NO_LOG_REDO || (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
......
...@@ -193,11 +193,6 @@ access order rules. */ ...@@ -193,11 +193,6 @@ access order rules. */
/** Operations that can currently be buffered. */ /** Operations that can currently be buffered. */
UNIV_INTERN ibuf_use_t ibuf_use = IBUF_USE_ALL; 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 */ /** The insert buffer control structure */
UNIV_INTERN ibuf_t* ibuf = NULL; UNIV_INTERN ibuf_t* ibuf = NULL;
...@@ -2649,6 +2644,12 @@ ibuf_contract_ext( ...@@ -2649,6 +2644,12 @@ ibuf_contract_ext(
return(0); 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); ibuf_mtr_start(&mtr);
/* Open a cursor to a randomly chosen leaf of the tree, at a random /* Open a cursor to a randomly chosen leaf of the tree, at a random
......
...@@ -63,4 +63,9 @@ typedef enum dict_err_ignore dict_err_ignore_t; ...@@ -63,4 +63,9 @@ typedef enum dict_err_ignore dict_err_ignore_t;
#define TEMP_TABLE_PREFIX "#sql" #define TEMP_TABLE_PREFIX "#sql"
#define TEMP_TABLE_PATH_PREFIX "/" TEMP_TABLE_PREFIX #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 #endif
...@@ -63,11 +63,6 @@ typedef enum { ...@@ -63,11 +63,6 @@ typedef enum {
/** Operations that can currently be buffered. */ /** Operations that can currently be buffered. */
extern ibuf_use_t ibuf_use; 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 */ /** The insert buffer control structure */
extern ibuf_t* ibuf; extern ibuf_t* ibuf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment