Commit 2e9f4cdc authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-21936 Assertion !btr_search_own... in btr_search_drop_page_hash_index

This is a regression due to the cleanup
commit 12f804ac.

row_sel_open_pcur(): Remove the unnecessary parameter.
It suffices for us to acquire the adaptive hash index latch
only when btr_search_guess_on_hash() is called by
btr_cur_search_to_nth_level_func(), in
btr_pcur_open_with_no_init().

This code seems to be a relic from the times when there was
only one btr_search_latch, which was held in shared mode
for longer periods of time. Another relic of that era was
removed in commit e5980bf1.
This clean-up was missed when the btr_search_latch was split in
mysql/mysql-server/commit@ab17ab91ce18a47bb6c5c49e4dc0505ad488a448
(MySQL 5.7.8).
parent 06fb78c6
......@@ -1288,10 +1288,6 @@ void
row_sel_open_pcur(
/*==============*/
plan_t* plan, /*!< in: table plan */
#ifdef BTR_CUR_HASH_ADAPT
rw_lock_t* ahi_latch,
/*!< in: the adaptive hash index latch */
#endif /* BTR_CUR_HASH_ADAPT */
mtr_t* mtr) /*!< in/out: mini-transaction */
{
dict_index_t* index;
......@@ -1335,7 +1331,7 @@ row_sel_open_pcur(
btr_pcur_open_with_no_init(index, plan->tuple, plan->mode,
BTR_SEARCH_LEAF, &plan->pcur,
ahi_latch, mtr);
NULL, mtr);
} else {
/* Open the cursor to the start or the end of the index
(FALSE: no init) */
......@@ -1480,16 +1476,12 @@ row_sel_try_search_shortcut(
ut_ad(plan->unique_search);
ut_ad(!plan->must_get_clust);
rw_lock_t* ahi_latch = btr_get_search_latch(index);
rw_lock_s_lock(ahi_latch);
row_sel_open_pcur(plan, ahi_latch, mtr);
row_sel_open_pcur(plan, mtr);
const rec_t* rec = btr_pcur_get_rec(&(plan->pcur));
if (!page_rec_is_user_rec(rec) || rec_is_metadata(rec, index)) {
retry:
rw_lock_s_unlock(ahi_latch);
return(SEL_RETRY);
}
......@@ -1501,7 +1493,6 @@ row_sel_try_search_shortcut(
if (btr_pcur_get_up_match(&(plan->pcur)) < plan->n_exact_match) {
exhausted:
rw_lock_s_unlock(ahi_latch);
return(SEL_EXHAUSTED);
}
......@@ -1547,7 +1538,6 @@ row_sel_try_search_shortcut(
ut_ad(plan->pcur.latch_mode == BTR_SEARCH_LEAF);
plan->n_rows_fetched++;
rw_lock_s_unlock(ahi_latch);
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
......@@ -1669,11 +1659,7 @@ row_sel(
if (!plan->pcur_is_open) {
/* Evaluate the expressions to build the search tuple and
open the cursor */
row_sel_open_pcur(plan,
#ifdef BTR_CUR_HASH_ADAPT
NULL,
#endif /* BTR_CUR_HASH_ADAPT */
&mtr);
row_sel_open_pcur(plan, &mtr);
cursor_just_opened = TRUE;
......
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