Commit 113c6278 authored by unknown's avatar unknown
Browse files

InnoDB: Cleanup and after review fixes.


innobase/btr/btr0btr.c:
  Code formatting: add blank line before "goto", do not indent labels
innobase/btr/btr0cur.c:
  Code formatting: add blank line before "goto"
innobase/btr/btr0pcur.c:
  btr_pcur_restore_position(): Replace assertion on cursor->pos_state
  with if condition, to provide better diagnostics. Restore ut_a()
  assertions on cursor->old_rec and cursor->old_n_fields.
innobase/btr/btr0sea.c:
  btr_search_check_guess(): Declare prev_rec and next_rec closer
  to usage.  Add blank lines before goto statements.
parent 59332c86
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1166,6 +1166,7 @@ btr_page_get_split_rec_to_right(
		} else {
			rec_t*	next_next_rec = page_rec_get_next(next_rec);
			if (page_rec_is_supremum(next_next_rec)) {

				goto split_at_new;
			}

@@ -1274,6 +1275,7 @@ btr_page_get_sure_split_rec(

				if (rec == ins_rec) {
					rec = NULL;

					goto func_exit;
				} else if (rec == NULL) {
					next_rec = page_rec_get_next(ins_rec);
+1 −0
Original line number Diff line number Diff line
@@ -1381,6 +1381,7 @@ btr_cur_parse_update_in_place(
	ptr = row_upd_index_parse(ptr, end_ptr, heap, &update);

	if (!ptr || !page) {

		goto func_exit;
	}

+6 −6
Original line number Diff line number Diff line
@@ -205,15 +205,15 @@ btr_pcur_restore_position(
	ulint		old_mode;
	mem_heap_t*	heap;

	ut_ad(cursor->pos_state == BTR_PCUR_WAS_POSITIONED
			|| cursor->pos_state == BTR_PCUR_IS_POSITIONED);
	if (UNIV_UNLIKELY(cursor->old_stored != BTR_PCUR_OLD_STORED)) {
	if (UNIV_UNLIKELY(cursor->old_stored != BTR_PCUR_OLD_STORED)
	    || UNIV_UNLIKELY(cursor->pos_state != BTR_PCUR_WAS_POSITIONED
			     && cursor->pos_state != BTR_PCUR_IS_POSITIONED)) {
		ut_print_buf(stderr, (const byte*)cursor, sizeof(btr_pcur_t));
		if (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
@@ -233,8 +233,8 @@ btr_pcur_restore_position(
		return(FALSE);
	}
	
	ut_ad(cursor->old_rec);
	ut_ad(cursor->old_n_fields);
	ut_a(cursor->old_rec);
	ut_a(cursor->old_n_fields);

	page = btr_cur_get_page(btr_pcur_get_btr_cur(cursor));

+24 −22
Original line number Diff line number Diff line
@@ -545,8 +545,6 @@ btr_search_check_guess(
	mtr_t*		mtr)	/* in: mtr */
{
	rec_t*		rec;
	rec_t*		prev_rec;
	rec_t*		next_rec;
	ulint		n_unique;
	ulint		match;
	ulint		bytes;
@@ -609,6 +607,7 @@ btr_search_check_guess(
	bytes = 0;

	if ((mode == PAGE_CUR_G) || (mode == PAGE_CUR_GE)) {
		rec_t*	prev_rec;

		ut_ad(!page_rec_is_infimum(rec));
		
@@ -617,6 +616,7 @@ btr_search_check_guess(
		if (page_rec_is_infimum(prev_rec)) {
			success = btr_page_get_prev(
				buf_frame_align(prev_rec), mtr) == FIL_NULL;

			goto exit_func;
		}

@@ -631,15 +631,16 @@ btr_search_check_guess(
		}

		goto exit_func;
	}
	} else {
		rec_t*	next_rec;

		ut_ad(!page_rec_is_supremum(rec));
	
		next_rec = page_rec_get_next(rec);

		if (page_rec_is_supremum(next_rec)) {
		if (btr_page_get_next(buf_frame_align(next_rec), mtr)
							== FIL_NULL) {
			if (btr_page_get_next(
				buf_frame_align(next_rec), mtr) == FIL_NULL) {

				cursor->up_match = 0;
				success = TRUE;
@@ -658,6 +659,7 @@ btr_search_check_guess(
		} else {
			success = cmp != 1;
		}
	}
exit_func:
	if (UNIV_LIKELY_NULL(heap)) {
		mem_heap_free(heap);