Commit 007bb37a authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-21962: Fix a bug in buf_pool_t::clear_hash_index()

parent f3a8ca9d
......@@ -840,7 +840,6 @@ btr_search_failure(btr_search_t* info, btr_cur_t* cursor)
info->last_hash_succ = FALSE;
}
#ifdef BTR_CUR_HASH_ADAPT
/** Clear the adaptive hash index on all pages in the buffer pool. */
inline void buf_pool_t::clear_hash_index()
{
......@@ -848,7 +847,7 @@ inline void buf_pool_t::clear_hash_index()
ut_ad(!resizing);
ut_ad(!btr_search_enabled);
for (chunk_t *chunk= chunks + n_chunks; --chunk != chunks; )
for (chunk_t *chunk= chunks + n_chunks; chunk-- != chunks; )
{
for (buf_block_t *block= chunk->blocks, * const end= block + chunk->size;
block != end; block++)
......@@ -882,7 +881,6 @@ inline void buf_pool_t::clear_hash_index()
}
}
}
#endif /* BTR_CUR_HASH_ADAPT */
/** Get a buffer block from an adaptive hash index pointer.
This function does not return if the block is not identified.
......
......@@ -2135,14 +2135,13 @@ inline void buf_pool_t::resize()
#ifdef BTR_CUR_HASH_ADAPT
/* disable AHI if needed */
bool btr_search_disabled = false;
const bool btr_search_disabled = btr_search_enabled;
buf_resize_status("Disabling adaptive hash index.");
btr_search_s_lock_all();
if (btr_search_enabled) {
if (btr_search_disabled) {
btr_search_s_unlock_all();
btr_search_disabled = true;
} else {
btr_search_s_unlock_all();
}
......
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