List:Commits« Previous MessageNext Message »
From:marko.makela Date:May 28 2012 1:40pm
Subject:bzr push into mysql-trunk-wl6255 branch (marko.makela:3879 to 3881) WL#6255
View as plain text  
 3881 Marko Mäkelä	2012-05-28
      WL#6255 preparation: Simplify the index->online_status for rebuilding table.
      
      dict_index_is_online_ddl(): On clustered index, assert that online_status
      is either ONLINE_INDEX_CREATION or ONLINE_INDEX_COMPLETE.
      
      dict_table_is_online_rebuild(): Invoke dict_index_is_online_ddl().

    modified:
      storage/innobase/include/dict0dict.h
      storage/innobase/include/dict0dict.ic
      storage/innobase/include/dict0mem.h
 3880 Marko Mäkelä	2012-05-28
      WL#6255 preparation: Fix a bug in the rec_get_offsets() elimination.
      
      btr_cur_optimistic_update(): Create *heap when needed.

    modified:
      storage/innobase/btr/btr0cur.cc
 3879 Marko Mäkelä	2012-05-28
      Convert ibool to bool.

    modified:
      storage/innobase/row/row0purge.cc
=== modified file 'storage/innobase/btr/btr0cur.cc'
--- a/storage/innobase/btr/btr0cur.cc	revid:marko.makela@stripped4fv612kllcjgysfh
+++ b/storage/innobase/btr/btr0cur.cc	revid:marko.makela@stripped70
@@ -2076,6 +2076,12 @@ any_extern:
 
 	page_cursor = btr_cur_get_page_cur(cursor);
 
+	if (!*heap) {
+		*heap = mem_heap_create(
+			rec_offs_size(*offsets)
+			+ DTUPLE_EST_ALLOC(rec_offs_n_fields(*offsets)));
+	}
+
 	new_entry = row_rec_to_index_entry(ROW_COPY_DATA, rec, index, *offsets,
 					   &n_ext, *heap);
 	/* We checked above that there are no externally stored fields. */

=== modified file 'storage/innobase/include/dict0dict.h'
--- a/storage/innobase/include/dict0dict.h	revid:marko.makela@oracle.com-20120528100950-4fv612kllcjgysfh
+++ b/storage/innobase/include/dict0dict.h	revid:marko.makela@stripped20528133824-t71zvj9ttz3qs070
@@ -1331,6 +1331,17 @@ dict_index_is_online_ddl(
 /*=====================*/
 	const dict_index_t*	index)	/*!< in: index */
 	__attribute__((nonnull, warn_unused_result));
+/********************************************************************//**
+Determines if a table is being rebuilt online,
+allowing concurrent modifications to the table.
+@retval true if the table is being rebuilt online
+@retval false otherwise */
+UNIV_INLINE
+bool
+dict_table_is_online_rebuild(
+/*=========================*/
+	const dict_table_t*	table)	/*!< in: table */
+	__attribute__((nonnull, warn_unused_result));
 /*********************************************************************//**
 Logs an operation to a secondary index that is being created. */
 UNIV_INTERN

=== modified file 'storage/innobase/include/dict0dict.ic'
--- a/storage/innobase/include/dict0dict.ic	revid:marko.makela@strippedom-20120528100950-4fv612kllcjgysfh
+++ b/storage/innobase/include/dict0dict.ic	revid:marko.makela@stripped528133824-t71zvj9ttz3qs070
@@ -1185,10 +1185,40 @@ dict_index_is_online_ddl(
 /*=====================*/
 	const dict_index_t*	index)	/*!< in: index */
 {
+#ifdef UNIV_DEBUG
+	if (dict_index_is_clust(index)) {
+		switch (dict_index_get_online_status(index)) {
+		case ONLINE_INDEX_CREATION:
+			return(true);
+		case ONLINE_INDEX_COMPLETE:
+			return(false);
+		case ONLINE_INDEX_ABORTED:
+		case ONLINE_INDEX_ABORTED_DROPPED:
+			break;
+		}
+		ut_ad(0);
+		return(false);
+	}
+#endif /* UNIV_DEBUG */
+
 	return(UNIV_UNLIKELY(dict_index_get_online_status(index)
 			     != ONLINE_INDEX_COMPLETE));
 }
 
+/********************************************************************//**
+Determines if a table is being rebuilt online,
+allowing concurrent modifications to the table.
+@retval true if the table is being rebuilt online
+@retval false otherwise */
+UNIV_INLINE
+bool
+dict_table_is_online_rebuild(
+/*=========================*/
+	const dict_table_t*	table)	/*!< in: table */
+{
+	return(dict_index_is_online_ddl(dict_table_get_first_index(table)));
+}
+
 /*********************************************************************//**
 Attempts to log an operation on a secondary index that is being created.
 @return TRUE if the operation was logged or the index creation failed;

=== modified file 'storage/innobase/include/dict0mem.h'
--- a/storage/innobase/include/dict0mem.h	revid:marko.makela@stripped950-4fv612kllcjgysfh
+++ b/storage/innobase/include/dict0mem.h	revid:marko.makela@stripped9ttz3qs070
@@ -491,12 +491,8 @@ struct dict_index_struct{
 				Transitions from ONLINE_INDEX_COMPLETE (to
 				ONLINE_INDEX_CREATION) are protected
 				by dict_operation_lock and
-				dict_sys->mutex. Transitions of the
-				clustered index from ONLINE_INDEX_CREATION
-				to ONLINE_INDEX_ABORTED (modification log
-				overflow or other error) are protected
-				by index->online_log->mutex. Other
-				changes are protected by index->lock. */
+				dict_sys->mutex. Other changes are
+				protected by index->lock. */
 	dict_field_t*	fields;	/*!< array of field descriptions */
 #ifndef UNIV_HOTBACKUP
 	UT_LIST_NODE_T(dict_index_t)

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl6255 branch (marko.makela:3879 to 3881) WL#6255marko.makela28 May