Commit f29b6ef0 authored by mmakela's avatar mmakela

branches/innodb+: btr_cur_search_to_nth_level(): Reduce the scope of node_ptr

and rearrange some code in order to eliminate an unwarranted
"possibly uninitialized" warning that was reported by Sunny.

rb://276 approved by Inaam Rana
parent 9280ce1e
......@@ -363,7 +363,6 @@ btr_cur_search_to_nth_level(
ulint space;
buf_block_t* guess;
ulint height;
rec_t* node_ptr;
ulint page_no;
ulint up_match;
ulint up_bytes;
......@@ -554,23 +553,6 @@ btr_cur_search_to_nth_level(
if (height != 0) {
/* We are about to fetch the root or a non-leaf page. */
} else if (dict_index_is_ibuf(index)) {
/* We're doing a search on an ibuf tree and we're one
level above the leaf page. */
ulint is_min_rec;
ut_ad(level == 0);
is_min_rec = rec_get_info_bits(node_ptr, 0)
& REC_INFO_MIN_REC_FLAG;
if (!is_min_rec) {
cursor->ibuf_cnt = ibuf_rec_get_counter(node_ptr);
ut_a(cursor->ibuf_cnt <= 0xFFFF
|| cursor->ibuf_cnt == ULINT_UNDEFINED);
}
} else if (latch_mode <= BTR_MODIFY_LEAF) {
rw_latch = latch_mode;
......@@ -729,6 +711,7 @@ btr_cur_search_to_nth_level(
if (level != height) {
const rec_t* node_ptr;
ut_ad(height > 0);
height--;
......@@ -742,6 +725,30 @@ btr_cur_search_to_nth_level(
/* Go to the child node */
page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
if (UNIV_UNLIKELY(height == 0 && dict_index_is_ibuf(index))) {
/* We're doing a search on an ibuf tree and we're one
level above the leaf page. */
ulint is_min_rec;
ut_ad(level == 0);
is_min_rec = rec_get_info_bits(node_ptr, 0)
& REC_INFO_MIN_REC_FLAG;
if (!is_min_rec) {
cursor->ibuf_cnt
= ibuf_rec_get_counter(node_ptr);
ut_a(cursor->ibuf_cnt <= 0xFFFF
|| cursor->ibuf_cnt == ULINT_UNDEFINED);
}
buf_mode = BUF_GET;
rw_latch = RW_NO_LATCH;
goto retry_page_get;
}
goto search_loop;
}
......
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