List:Commits« Previous MessageNext Message »
From:marko.makela Date:June 20 2012 9:19pm
Subject:bzr push into mysql-trunk-wl6255 branch (marko.makela:4009 to 4012) WL#6255
View as plain text  
 4012 Marko Mäkelä	2012-06-21
      WL#6255 dead code removal.
      
      row_rec_to_index_entry(): Remove the constant parameter type=ROW_COPY_DATA.

    modified:
      storage/innobase/btr/btr0cur.cc
      storage/innobase/include/row0row.h
      storage/innobase/row/row0mysql.cc
      storage/innobase/row/row0row.cc
      storage/innobase/row/row0upd.cc
      storage/innobase/trx/trx0rec.cc
 4011 Marko Mäkelä	2012-06-21
      WL#6255 dead code removal.
      
      prepare_inplace_alter_table_dict(): Remove the unreachable check for
      get_innobase_type_from_mysql_type() returning 0. It would do
      ut_error (abort) before doing that.

    modified:
      storage/innobase/handler/handler0alter.cc
 4010 Marko Mäkelä	2012-06-21
      WL#6255 dead code removal.
      
      row_build(): When rebuilding a table, we always pass col_map[].
      Dropping columns requires a table rebuild, so it will suffice to check
      the col_map[] for any dropped columns.

    modified:
      storage/innobase/row/row0row.cc
 4009 Marko Mäkelä	2012-06-20
      Adjust index cardinality statistics calculation for WL#6255.
      
      Do not skip statistics calculation if the table is being rebuilt online.
      The outcome of the function dict_index_is_online_ddl() changes a bit in
      WL#6255. Before WL#6255, it could only hold for secondary indexes.
      After WL#6255, if dict_index_is_online_ddl() holds for a clustered index,
      it means that the table is fully accessible, but it is merely being rebuilt
      online and all changes to the table must be logged.
      
      Index cardinality statistics calculation does not modify the table.
      Therefore, it must continue "business as usual" for tables that happen
      to be subjected to online rebuild.
      
      This might have caused Valgrind warnings about reading uninitialized memory
      in main.innodb_icp_all.

    modified:
      storage/innobase/dict/dict0stats.cc
=== modified file 'storage/innobase/btr/btr0cur.cc'
--- a/storage/innobase/btr/btr0cur.cc	revid:marko.makela@stripped1i2757lehhj
+++ b/storage/innobase/btr/btr0cur.cc	revid:marko.makela@stripped
@@ -2092,7 +2092,7 @@ any_extern:
 			+ DTUPLE_EST_ALLOC(rec_offs_n_fields(*offsets)));
 	}
 
-	new_entry = row_rec_to_index_entry(ROW_COPY_DATA, rec, index, *offsets,
+	new_entry = row_rec_to_index_entry(rec, index, *offsets,
 					   &n_ext, *heap);
 	/* We checked above that there are no externally stored fields. */
 	ut_a(!n_ext);
@@ -2365,7 +2365,7 @@ btr_cur_pessimistic_update(
 		rec, index, *offsets, ULINT_UNDEFINED, offsets_heap);
 
 	dtuple_t*	new_entry = row_rec_to_index_entry(
-		ROW_COPY_DATA, rec, index, *offsets, &n_ext, entry_heap);
+		rec, index, *offsets, &n_ext, entry_heap);
 
 	/* The page containing the clustered index record
 	corresponding to new_entry is latched in mtr.  If the

=== modified file 'storage/innobase/handler/handler0alter.cc'
--- a/storage/innobase/handler/handler0alter.cc	revid:marko.makela@stripped620120926-3dmjk1i2757lehhj
+++ b/storage/innobase/handler/handler0alter.cc	revid:marko.makela@stripped11514-86l8m5byase2k2ow
@@ -2512,14 +2512,6 @@ prepare_inplace_alter_table_dict(
 			ulint		charset_no;
 			ulint		col_len;
 
-			if (!col_type) {
-col_fail:
-				dict_mem_table_free(indexed_table);
-				my_error(ER_WRONG_KEY_COLUMN, MYF(0),
-					 field->field_name);
-				goto new_clustered_failed;
-			}
-
 			/* we assume in dtype_form_prtype() that this
 			fits in two bytes */
 			ut_a(field_type <= MAX_CHAR_COLL_NUM);
@@ -2540,7 +2532,10 @@ col_fail:
 				charset_no = (ulint) field->charset()->number;
 
 				if (charset_no > MAX_CHAR_COLL_NUM) {
-					goto col_fail;
+					dict_mem_table_free(indexed_table);
+					my_error(ER_WRONG_KEY_COLUMN, MYF(0),
+						 field->field_name);
+					goto new_clustered_failed;
 				}
 			} else {
 				charset_no = 0;

=== modified file 'storage/innobase/include/row0row.h'
--- a/storage/innobase/include/row0row.h	revid:marko.makela@stripped1i2757lehhj
+++ b/storage/innobase/include/row0row.h	revid:marko.makela@stripped
@@ -173,26 +173,12 @@ row_rec_to_index_entry_low(
 /*******************************************************************//**
 Converts an index record to a typed data tuple. NOTE that externally
 stored (often big) fields are NOT copied to heap.
-@return	own: index entry built; see the NOTE below! */
+@return	own: index entry built */
 UNIV_INTERN
 dtuple_t*
 row_rec_to_index_entry(
 /*===================*/
-	ulint			type,	/*!< in: ROW_COPY_DATA, or
-					ROW_COPY_POINTERS: the former
-					copies also the data fields to
-					heap as the latter only places
-					pointers to data fields on the
-					index page */
-	const rec_t*		rec,	/*!< in: record in the index;
-					NOTE: in the case
-					ROW_COPY_POINTERS the data
-					fields in the row will point
-					directly into this record,
-					therefore, the buffer page of
-					this record must be at least
-					s-latched and the latch held
-					as long as the dtuple is used! */
+	const rec_t*		rec,	/*!< in: record in the index */
 	const dict_index_t*	index,	/*!< in: index */
 	const ulint*		offsets,/*!< in/out: rec_get_offsets(rec) */
 	ulint*			n_ext,	/*!< out: number of externally

=== modified file 'storage/innobase/row/row0mysql.cc'
--- a/storage/innobase/row/row0mysql.cc	revid:marko.makela@stripped
+++ b/storage/innobase/row/row0mysql.cc	revid:marko.makela@oracle.com-20120620211514-86l8m5byase2k2ow
@@ -5038,9 +5038,8 @@ not_ok:
 
 		mem_heap_empty(heap);
 
-		prev_entry = row_rec_to_index_entry(ROW_COPY_DATA, rec,
-						    index, offsets,
-						    &n_ext, heap);
+		prev_entry = row_rec_to_index_entry(
+			rec, index, offsets, &n_ext, heap);
 
 		if (UNIV_LIKELY_NULL(tmp_heap)) {
 			mem_heap_free(tmp_heap);

=== modified file 'storage/innobase/row/row0row.cc'
--- a/storage/innobase/row/row0row.cc	revid:marko.makela@strippedhj
+++ b/storage/innobase/row/row0row.cc	revid:marko.makela@stripped
@@ -334,9 +334,6 @@ row_build(
 				/* dropped column */
 				continue;
 			}
-		} else if (col_no >= dict_table_get_n_cols(col_table)) {
-			/* dropped last columns */
-			continue;
 		}
 
 		dfield_t*	dfield = dtuple_get_nth_field(row, col_no);
@@ -445,26 +442,12 @@ row_rec_to_index_entry_low(
 /*******************************************************************//**
 Converts an index record to a typed data tuple. NOTE that externally
 stored (often big) fields are NOT copied to heap.
-@return	own: index entry built; see the NOTE below! */
+@return	own: index entry built */
 UNIV_INTERN
 dtuple_t*
 row_rec_to_index_entry(
 /*===================*/
-	ulint			type,	/*!< in: ROW_COPY_DATA, or
-					ROW_COPY_POINTERS: the former
-					copies also the data fields to
-					heap as the latter only places
-					pointers to data fields on the
-					index page */
-	const rec_t*		rec,	/*!< in: record in the index;
-					NOTE: in the case
-					ROW_COPY_POINTERS the data
-					fields in the row will point
-					directly into this record,
-					therefore, the buffer page of
-					this record must be at least
-					s-latched and the latch held
-					as long as the dtuple is used! */
+	const rec_t*		rec,	/*!< in: record in the index */
 	const dict_index_t*	index,	/*!< in: index */
 	const ulint*		offsets,/*!< in: rec_get_offsets(rec) */
 	ulint*			n_ext,	/*!< out: number of externally
@@ -479,18 +462,11 @@ row_rec_to_index_entry(
 	ut_ad(rec && heap && index);
 	ut_ad(rec_offs_validate(rec, index, offsets));
 
-	if (type == ROW_COPY_DATA) {
-		/* Take a copy of rec to heap */
-		buf = static_cast<byte*>(
-			mem_heap_alloc(heap, rec_offs_size(offsets)));
+	/* Take a copy of rec to heap */
+	buf = static_cast<byte*>(
+		mem_heap_alloc(heap, rec_offs_size(offsets)));
 
-		copy_rec = rec_copy(buf, rec, offsets);
-	} else {
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
-		ut_a(!rec_offs_any_null_extern(rec, offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
-		copy_rec = rec;
-	}
+	copy_rec = rec_copy(buf, rec, offsets);
 
 	rec_offs_make_valid(copy_rec, index, const_cast<ulint*>(offsets));
 	entry = row_rec_to_index_entry_low(

=== modified file 'storage/innobase/row/row0upd.cc'
--- a/storage/innobase/row/row0upd.cc	revid:marko.makela@stripped20120620120926-3dmjk1i2757lehhj
+++ b/storage/innobase/row/row0upd.cc	revid:marko.makela@stripped-86l8m5byase2k2ow
@@ -213,8 +213,7 @@ row_upd_check_references_constraints(
 
 	heap = mem_heap_create(500);
 
-	entry = row_rec_to_index_entry(ROW_COPY_DATA, rec, index, offsets,
-				       &n_ext, heap);
+	entry = row_rec_to_index_entry(rec, index, offsets, &n_ext, heap);
 
 	mtr_commit(mtr);
 

=== modified file 'storage/innobase/trx/trx0rec.cc'
--- a/storage/innobase/trx/trx0rec.cc	revid:marko.makela@stripped
+++ b/storage/innobase/trx/trx0rec.cc	revid:marko.makela@oracle.com-20120620211514-86l8m5byase2k2ow
@@ -1611,8 +1611,8 @@ trx_undo_prev_version_build(
 		those fields that update updates to become externally stored
 		fields. Store the info: */
 
-		entry = row_rec_to_index_entry(ROW_COPY_DATA, rec, index,
-					       offsets, &n_ext, heap);
+		entry = row_rec_to_index_entry(
+			rec, index, offsets, &n_ext, heap);
 		n_ext += btr_push_update_extern_fields(entry, update, heap);
 		/* The page containing the clustered index record
 		corresponding to entry is latched in mtr.  Thus the

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl6255 branch (marko.makela:4009 to 4012) WL#6255marko.makela21 Jun