List:Commits« Previous MessageNext Message »
From:marko.makela Date:May 23 2012 7:56pm
Subject:bzr push into mysql-trunk-wl6255 branch (marko.makela:3857 to 3858)
View as plain text  
 3858 Marko Mäkelä	2012-05-23
      Simplify rec_offs_make_valid() calls.

    modified:
      storage/innobase/api/api0api.cc
      storage/innobase/btr/btr0cur.cc
      storage/innobase/row/row0row.cc
 3857 Marko Mäkelä	2012-05-23
      WL#6255 preparation: Add the accessor trx_undo_trx_id_is_insert().

    modified:
      storage/innobase/include/trx0undo.h
      storage/innobase/include/trx0undo.ic
      storage/innobase/row/row0merge.cc
=== modified file 'storage/innobase/api/api0api.cc'
--- a/storage/innobase/api/api0api.cc	revid:marko.makela@stripped20120523134214-9wp928wdmv0k82hk
+++ b/storage/innobase/api/api0api.cc	revid:marko.makela@stripped-i13jjx2rxt43xum5
@@ -380,9 +380,6 @@ ib_read_tuple(
 	ptr = mem_heap_alloc(tuple->heap, rec_offs_size(offsets));
 	copy = rec_copy(ptr, rec, offsets);
 
-	/* Avoid a debug assertion in rec_offs_validate(). */
-	rec_offs_make_valid(rec, index, (ulint*) offsets);
-
 	n_index_fields = ut_min(
 		rec_offs_n_fields(offsets), dtuple_get_n_fields(dtuple));
 

=== modified file 'storage/innobase/btr/btr0cur.cc'
--- a/storage/innobase/btr/btr0cur.cc	revid:marko.makela@stripped
+++ b/storage/innobase/btr/btr0cur.cc	revid:marko.makela@oracle.com-20120523195532-i13jjx2rxt43xum5
@@ -2134,12 +2134,6 @@ any_extern:
 
 	btr_search_update_hash_on_delete(cursor);
 
-	/* The call to row_rec_to_index_entry(ROW_COPY_DATA, ...) above
-	invokes rec_offs_make_valid() to point to the copied record that
-	the fields of new_entry point to.  We have to undo it here. */
-	ut_ad(rec_offs_validate(NULL, index, *offsets));
-	rec_offs_make_valid(page_cur_get_rec(page_cursor), index, *offsets);
-
 	page_cur_delete_rec(page_cursor, index, *offsets, mtr);
 
 	page_cur_move_to_prev(page_cursor);
@@ -2340,11 +2334,6 @@ btr_cur_pessimistic_update(
 
 	new_entry = row_rec_to_index_entry(ROW_COPY_DATA, rec, index, *offsets,
 					   &n_ext, *heap);
-	/* The call to row_rec_to_index_entry(ROW_COPY_DATA, ...) above
-	invokes rec_offs_make_valid() to point to the copied record that
-	the fields of new_entry point to.  We have to undo it here. */
-	ut_ad(rec_offs_validate(NULL, index, *offsets));
-	rec_offs_make_valid(rec, index, *offsets);
 
 	/* The page containing the clustered index record
 	corresponding to new_entry is latched in mtr.  If the

=== modified file 'storage/innobase/row/row0row.cc'
--- a/storage/innobase/row/row0row.cc	revid:marko.makela@stripped
+++ b/storage/innobase/row/row0row.cc	revid:marko.makela@oracle.com-20120523195532-i13jjx2rxt43xum5
@@ -223,6 +223,7 @@ row_build(
 	mem_heap_t*		heap)	/*!< in: memory heap from which
 					the memory needed is allocated */
 {
+	const byte*		copy;
 	dtuple_t*		row;
 	const dict_table_t*	table;
 	ulint			n_fields;
@@ -266,9 +267,9 @@ row_build(
 		buf = static_cast<byte*>(
 			mem_heap_alloc(heap, rec_offs_size(offsets)));
 
-		rec = rec_copy(buf, rec, offsets);
-		/* Avoid a debug assertion in rec_offs_validate(). */
-		rec_offs_make_valid(rec, index, (ulint*) offsets);
+		copy = rec_copy(buf, rec, offsets);
+	} else {
+		copy = rec;
 	}
 
 	table = index->table;
@@ -288,6 +289,9 @@ row_build(
 			mem_heap_alloc(heap, n_ext_cols * sizeof *ext_cols));
 	}
 
+	/* Avoid a debug assertion in rec_offs_validate(). */
+	rec_offs_make_valid(copy, index, const_cast<ulint*>(offsets));
+
 	for (i = j = 0; i < n_fields; i++) {
 		dict_field_t*		ind_field
 			= dict_index_get_nth_field(index, i);
@@ -301,7 +305,7 @@ row_build(
 		if (ind_field->prefix_len == 0) {
 
 			const byte*	field = rec_get_nth_field(
-				rec, offsets, i, &len);
+				copy, offsets, i, &len);
 
 			dfield_set_data(dfield, field, len);
 		}
@@ -325,6 +329,8 @@ row_build(
 		}
 	}
 
+	rec_offs_make_valid(rec, index, const_cast<ulint*>(offsets));
+
 	ut_ad(dtuple_check_typed(row));
 
 	if (!ext) {

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl6255 branch (marko.makela:3857 to 3858) marko.makela24 May