List:Internals« Previous MessageNext Message »
From:Marko Mäkelä Date:June 14 2005 9:21am
Subject:bk commit into 5.0 tree (marko:1.1875)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of marko. When marko does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1875 05/06/14 12:21:40 marko@stripped +4 -0
  InnoDB: Cleanup and after review fixes.

  innobase/btr/btr0sea.c
    1.33 05/06/14 12:21:31 marko@stripped +24 -22
    btr_search_check_guess(): Declare prev_rec and next_rec closer
    to usage.  Add blank lines before goto statements.

  innobase/btr/btr0pcur.c
    1.15 05/06/14 12:21:31 marko@stripped +6 -6
    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/btr0cur.c
    1.50 05/06/14 12:21:31 marko@stripped +1 -0
    Code formatting: add blank line before "goto"

  innobase/btr/btr0btr.c
    1.43 05/06/14 12:21:31 marko@stripped +4 -2
    Code formatting: add blank line before "goto", do not indent labels

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	marko
# Host:	hundin.mysql.fi
# Root:	/home/marko/mysql-5.0

--- 1.42/innobase/btr/btr0btr.c	Wed Apr 27 12:28:34 2005
+++ 1.43/innobase/btr/btr0btr.c	Tue Jun 14 12:21:31 2005
@@ -1160,12 +1160,13 @@
 		next_rec = page_rec_get_next(insert_point);
 
 		if (page_rec_is_supremum(next_rec)) {
-		split_at_new:
+split_at_new:
 			/* Split at the new record to insert */
 	     		*split_rec = NULL;
 		} 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 @@
 
 				if (rec == ins_rec) {
 					rec = NULL;
+
 					goto func_exit;
 				} else if (rec == NULL) {
 					next_rec = page_rec_get_next(ins_rec);
@@ -1286,7 +1288,7 @@
 				}
                     	}
 
-		func_exit:
+func_exit:
 			if (UNIV_LIKELY_NULL(heap)) {
 				mem_heap_free(heap);
 			}

--- 1.49/innobase/btr/btr0cur.c	Fri Jun 10 11:32:30 2005
+++ 1.50/innobase/btr/btr0cur.c	Tue Jun 14 12:21:31 2005
@@ -1381,6 +1381,7 @@
 	ptr = row_upd_index_parse(ptr, end_ptr, heap, &update);
 
 	if (!ptr || !page) {
+
 		goto func_exit;
 	}
 

--- 1.14/innobase/btr/btr0pcur.c	Mon Apr 25 10:14:25 2005
+++ 1.15/innobase/btr/btr0pcur.c	Tue Jun 14 12:21:31 2005
@@ -205,15 +205,15 @@
 	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 @@
 		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));
 

--- 1.32/innobase/btr/btr0sea.c	Mon Apr 25 10:14:25 2005
+++ 1.33/innobase/btr/btr0sea.c	Tue Jun 14 12:21:31 2005
@@ -545,8 +545,6 @@
 	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 @@
 	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 @@
 		if (page_rec_is_infimum(prev_rec)) {
 			success = btr_page_get_prev(
 				buf_frame_align(prev_rec), mtr) == FIL_NULL;
+
 			goto exit_func;
 		}
 
@@ -631,32 +631,34 @@
 		}
 
 		goto exit_func;
-	}
-		
-	ut_ad(!page_rec_is_supremum(rec));
+	} else {
+		rec_t*	next_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 (btr_page_get_next(buf_frame_align(next_rec), mtr)
-							== FIL_NULL) {
+		if (page_rec_is_supremum(next_rec)) {
+			if (btr_page_get_next(
+				buf_frame_align(next_rec), mtr) == FIL_NULL) {
 
-			cursor->up_match = 0;
-			success = TRUE;
-		}
+				cursor->up_match = 0;
+				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);
-	cmp = page_cmp_dtuple_rec_with_match(tuple, next_rec,
-					offsets, &match, &bytes);
-	if (mode == PAGE_CUR_LE) {
-		success = cmp == -1;
-		cursor->up_match = match;
-	} else {
-		success = cmp != 1;
+		cmp = page_cmp_dtuple_rec_with_match(tuple, next_rec,
+						offsets, &match, &bytes);
+		if (mode == PAGE_CUR_LE) {
+			success = cmp == -1;
+			cursor->up_match = match;
+		} else {
+			success = cmp != 1;
+		}
 	}
 exit_func:
 	if (UNIV_LIKELY_NULL(heap)) {
Thread
bk commit into 5.0 tree (marko:1.1875)Marko Mäkelä14 Jun