Commit 9084d3dd authored by marko@hundin.mysql.fi's avatar marko@hundin.mysql.fi

InnoDB: Cleanup and after review fixes.

parent 40516ad8
...@@ -1160,12 +1160,13 @@ btr_page_get_split_rec_to_right( ...@@ -1160,12 +1160,13 @@ btr_page_get_split_rec_to_right(
next_rec = page_rec_get_next(insert_point); next_rec = page_rec_get_next(insert_point);
if (page_rec_is_supremum(next_rec)) { if (page_rec_is_supremum(next_rec)) {
split_at_new: split_at_new:
/* Split at the new record to insert */ /* Split at the new record to insert */
*split_rec = NULL; *split_rec = NULL;
} else { } else {
rec_t* next_next_rec = page_rec_get_next(next_rec); rec_t* next_next_rec = page_rec_get_next(next_rec);
if (page_rec_is_supremum(next_next_rec)) { if (page_rec_is_supremum(next_next_rec)) {
goto split_at_new; goto split_at_new;
} }
...@@ -1274,6 +1275,7 @@ btr_page_get_sure_split_rec( ...@@ -1274,6 +1275,7 @@ btr_page_get_sure_split_rec(
if (rec == ins_rec) { if (rec == ins_rec) {
rec = NULL; rec = NULL;
goto func_exit; goto func_exit;
} else if (rec == NULL) { } else if (rec == NULL) {
next_rec = page_rec_get_next(ins_rec); next_rec = page_rec_get_next(ins_rec);
...@@ -1286,7 +1288,7 @@ btr_page_get_sure_split_rec( ...@@ -1286,7 +1288,7 @@ btr_page_get_sure_split_rec(
} }
} }
func_exit: func_exit:
if (UNIV_LIKELY_NULL(heap)) { if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap); mem_heap_free(heap);
} }
......
...@@ -1381,6 +1381,7 @@ btr_cur_parse_update_in_place( ...@@ -1381,6 +1381,7 @@ btr_cur_parse_update_in_place(
ptr = row_upd_index_parse(ptr, end_ptr, heap, &update); ptr = row_upd_index_parse(ptr, end_ptr, heap, &update);
if (!ptr || !page) { if (!ptr || !page) {
goto func_exit; goto func_exit;
} }
......
...@@ -205,15 +205,15 @@ btr_pcur_restore_position( ...@@ -205,15 +205,15 @@ btr_pcur_restore_position(
ulint old_mode; ulint old_mode;
mem_heap_t* heap; mem_heap_t* heap;
ut_ad(cursor->pos_state == BTR_PCUR_WAS_POSITIONED if (UNIV_UNLIKELY(cursor->old_stored != BTR_PCUR_OLD_STORED)
|| cursor->pos_state == BTR_PCUR_IS_POSITIONED); || UNIV_UNLIKELY(cursor->pos_state != BTR_PCUR_WAS_POSITIONED
if (UNIV_UNLIKELY(cursor->old_stored != BTR_PCUR_OLD_STORED)) { && cursor->pos_state != BTR_PCUR_IS_POSITIONED)) {
ut_print_buf(stderr, (const byte*)cursor, sizeof(btr_pcur_t)); ut_print_buf(stderr, (const byte*)cursor, sizeof(btr_pcur_t));
if (cursor->trx_if_known) { if (cursor->trx_if_known) {
trx_print(stderr, cursor->trx_if_known); trx_print(stderr, cursor->trx_if_known);
} }
ut_a(0); ut_error;
} }
if (UNIV_UNLIKELY(cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE if (UNIV_UNLIKELY(cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE
...@@ -233,8 +233,8 @@ btr_pcur_restore_position( ...@@ -233,8 +233,8 @@ btr_pcur_restore_position(
return(FALSE); return(FALSE);
} }
ut_ad(cursor->old_rec); ut_a(cursor->old_rec);
ut_ad(cursor->old_n_fields); ut_a(cursor->old_n_fields);
page = btr_cur_get_page(btr_pcur_get_btr_cur(cursor)); page = btr_cur_get_page(btr_pcur_get_btr_cur(cursor));
......
...@@ -545,8 +545,6 @@ btr_search_check_guess( ...@@ -545,8 +545,6 @@ btr_search_check_guess(
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /* in: mtr */
{ {
rec_t* rec; rec_t* rec;
rec_t* prev_rec;
rec_t* next_rec;
ulint n_unique; ulint n_unique;
ulint match; ulint match;
ulint bytes; ulint bytes;
...@@ -609,6 +607,7 @@ btr_search_check_guess( ...@@ -609,6 +607,7 @@ btr_search_check_guess(
bytes = 0; bytes = 0;
if ((mode == PAGE_CUR_G) || (mode == PAGE_CUR_GE)) { if ((mode == PAGE_CUR_G) || (mode == PAGE_CUR_GE)) {
rec_t* prev_rec;
ut_ad(!page_rec_is_infimum(rec)); ut_ad(!page_rec_is_infimum(rec));
...@@ -617,6 +616,7 @@ btr_search_check_guess( ...@@ -617,6 +616,7 @@ btr_search_check_guess(
if (page_rec_is_infimum(prev_rec)) { if (page_rec_is_infimum(prev_rec)) {
success = btr_page_get_prev( success = btr_page_get_prev(
buf_frame_align(prev_rec), mtr) == FIL_NULL; buf_frame_align(prev_rec), mtr) == FIL_NULL;
goto exit_func; goto exit_func;
} }
...@@ -631,32 +631,34 @@ btr_search_check_guess( ...@@ -631,32 +631,34 @@ btr_search_check_guess(
} }
goto exit_func; goto exit_func;
} } else {
rec_t* next_rec;
ut_ad(!page_rec_is_supremum(rec));
ut_ad(!page_rec_is_supremum(rec));
next_rec = page_rec_get_next(rec); next_rec = page_rec_get_next(rec);
if (page_rec_is_supremum(next_rec)) { if (page_rec_is_supremum(next_rec)) {
if (btr_page_get_next(buf_frame_align(next_rec), mtr) if (btr_page_get_next(
== FIL_NULL) { buf_frame_align(next_rec), mtr) == FIL_NULL) {
cursor->up_match = 0; cursor->up_match = 0;
success = TRUE; success = TRUE;
} }
goto exit_func; goto exit_func;
} }
offsets = rec_get_offsets(next_rec, cursor->index, offsets, offsets = rec_get_offsets(next_rec, cursor->index, offsets,
n_unique, &heap); n_unique, &heap);
cmp = page_cmp_dtuple_rec_with_match(tuple, next_rec, cmp = page_cmp_dtuple_rec_with_match(tuple, next_rec,
offsets, &match, &bytes); offsets, &match, &bytes);
if (mode == PAGE_CUR_LE) { if (mode == PAGE_CUR_LE) {
success = cmp == -1; success = cmp == -1;
cursor->up_match = match; cursor->up_match = match;
} else { } else {
success = cmp != 1; success = cmp != 1;
}
} }
exit_func: exit_func:
if (UNIV_LIKELY_NULL(heap)) { if (UNIV_LIKELY_NULL(heap)) {
......
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