mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
branches/zip: btr_search_guess_on_hash(): Eliminate two local variables
and optimize one test.
This commit is contained in:
parent
36734f3420
commit
9a94888273
1 changed files with 3 additions and 13 deletions
|
@ -727,9 +727,7 @@ btr_search_guess_on_hash(
|
||||||
rec_t* rec;
|
rec_t* rec;
|
||||||
const page_t* page;
|
const page_t* page;
|
||||||
ulint fold;
|
ulint fold;
|
||||||
ulint tuple_n_fields;
|
|
||||||
dulint index_id;
|
dulint index_id;
|
||||||
ibool can_only_compare_to_cursor_rec = TRUE;
|
|
||||||
#ifdef notdefined
|
#ifdef notdefined
|
||||||
btr_cur_t cursor2;
|
btr_cur_t cursor2;
|
||||||
btr_pcur_t pcur;
|
btr_pcur_t pcur;
|
||||||
|
@ -749,15 +747,8 @@ btr_search_guess_on_hash(
|
||||||
cursor->n_fields = info->n_fields;
|
cursor->n_fields = info->n_fields;
|
||||||
cursor->n_bytes = info->n_bytes;
|
cursor->n_bytes = info->n_bytes;
|
||||||
|
|
||||||
tuple_n_fields = dtuple_get_n_fields(tuple);
|
if (UNIV_UNLIKELY(dtuple_get_n_fields(tuple)
|
||||||
|
< cursor->n_fields + (cursor->n_bytes > 0))) {
|
||||||
if (UNIV_UNLIKELY(tuple_n_fields < cursor->n_fields)) {
|
|
||||||
|
|
||||||
return(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (UNIV_UNLIKELY(tuple_n_fields == cursor->n_fields)
|
|
||||||
&& (cursor->n_bytes > 0)) {
|
|
||||||
|
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
@ -820,7 +811,6 @@ btr_search_guess_on_hash(
|
||||||
}
|
}
|
||||||
|
|
||||||
rw_lock_s_unlock(&btr_search_latch);
|
rw_lock_s_unlock(&btr_search_latch);
|
||||||
can_only_compare_to_cursor_rec = FALSE;
|
|
||||||
|
|
||||||
#ifdef UNIV_SYNC_DEBUG
|
#ifdef UNIV_SYNC_DEBUG
|
||||||
buf_block_dbg_add_level(block, SYNC_TREE_NODE_FROM_HASH);
|
buf_block_dbg_add_level(block, SYNC_TREE_NODE_FROM_HASH);
|
||||||
|
@ -852,7 +842,7 @@ btr_search_guess_on_hash(
|
||||||
if (UNIV_EXPECT(
|
if (UNIV_EXPECT(
|
||||||
ut_dulint_cmp(index_id, btr_page_get_index_id(page)), 0)
|
ut_dulint_cmp(index_id, btr_page_get_index_id(page)), 0)
|
||||||
|| !btr_search_check_guess(cursor,
|
|| !btr_search_check_guess(cursor,
|
||||||
can_only_compare_to_cursor_rec,
|
has_search_latch,
|
||||||
tuple, mode, mtr)) {
|
tuple, mode, mtr)) {
|
||||||
if (UNIV_LIKELY(!has_search_latch)) {
|
if (UNIV_LIKELY(!has_search_latch)) {
|
||||||
btr_leaf_page_release(block, latch_mode, mtr);
|
btr_leaf_page_release(block, latch_mode, mtr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue