List:Commits« Previous MessageNext Message »
From:marko.makela Date:May 15 2012 10:44am
Subject:bzr push into mysql-trunk-wl6255 branch (marko.makela:3833 to 3835) WL#6255
View as plain text  
 3835 Marko Mäkelä	2012-05-15
      WL#6255 preparation. Separate index->search_info and index->online_log.
      
      In an attempt to reduce memory usage, WL#5526 piggy-backed the online_log
      pointer in place of the index->search_info. It was thought that the
      adaptive hash index would not be used while building an index online.
      
      With WL#6255, this no longer holds. The adaptive hash index for the
      clustered index must remain accessible while the table is being rebuilt.
      
      BTR_MODIFY_LEAF_APPLY_LOG: Replace with BTR_MODIFY_LEAF.
      BTR_MODIFY_TREE_APPLY_LOG: Replace with BTR_MODIFY_TREE.
      
      btr_search_get_info(): Do not assert that the index is not being built
      online.
      
      btr_cur_search_to_nth_level(): Always use the adaptive hash index.

    modified:
      storage/innobase/btr/btr0cur.cc
      storage/innobase/btr/btr0sea.cc
      storage/innobase/dict/dict0dict.cc
      storage/innobase/include/btr0btr.h
      storage/innobase/include/btr0sea.h
      storage/innobase/include/btr0sea.ic
      storage/innobase/include/dict0mem.h
      storage/innobase/row/row0log.cc
 3834 Marko Mäkelä	2012-05-15
      WL#6255 prepareation: Simplify row_ins_clust_index_entry_low().

    modified:
      storage/innobase/row/row0ins.cc
 3833 Marko Mäkelä	2012-05-15
      WL#6255 preparation: Split row_ins_index_entry(), row_ins_index_entry_low().
      
      row_ins_clust_index_entry(): Insert a clustered index entry.
      row_ins_sec_index_entry(): Insert a secondary index entry.
      
      row_ins_clust_index_entry_low(): Insert a clustered index entry.
      row_ins_sec_index_entry_low(): Insert a secondary index entry.
      
      Remove the parameter foreign=TRUE from all functions and n_ext=0
      from the insert into secondary index.

    modified:
      storage/innobase/ibuf/ibuf0ibuf.cc
      storage/innobase/include/row0ins.h
      storage/innobase/row/row0ins.cc
      storage/innobase/row/row0upd.cc
=== 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@strippedm-20120515104310-wqf7uxiqfr9b4dfc
@@ -253,7 +253,6 @@ btr_cur_latch_leaves(
 	switch (latch_mode) {
 	case BTR_SEARCH_LEAF:
 	case BTR_MODIFY_LEAF:
-	case BTR_MODIFY_LEAF_APPLY_LOG:
 		mode = latch_mode == BTR_SEARCH_LEAF ? RW_S_LATCH : RW_X_LATCH;
 		get_block = btr_block_get(
 			space, zip_size, page_no, mode, cursor->index, mtr);
@@ -263,7 +262,6 @@ btr_cur_latch_leaves(
 		get_block->check_index_page_at_flush = TRUE;
 		return;
 	case BTR_MODIFY_TREE:
-	case BTR_MODIFY_TREE_APPLY_LOG:
 		/* x-latch also brothers from left to right */
 		left_page_no = btr_page_get_prev(page, mtr);
 
@@ -384,7 +382,7 @@ btr_cur_search_to_nth_level(
 	page_t*		page;
 	buf_block_t*	block;
 	ulint		space;
-	buf_block_t*	guess	= NULL;
+	buf_block_t*	guess;
 	ulint		height;
 	ulint		page_no;
 	ulint		up_match;
@@ -480,18 +478,6 @@ btr_cur_search_to_nth_level(
 #ifndef BTR_CUR_ADAPT
 	guess = NULL;
 #else
-	switch (latch_mode) {
-	default:
-		if (level == 0) {
-			break;
-		}
-		/* fall through */
-	case BTR_MODIFY_TREE_APPLY_LOG:
-	case BTR_MODIFY_LEAF_APPLY_LOG:
-		info = NULL;
-		goto no_guess;
-	}
-
 	info = btr_search_get_info(index);
 
 	guess = info->root_guess;
@@ -529,7 +515,6 @@ btr_cur_search_to_nth_level(
 		return;
 	}
 # endif /* BTR_CUR_HASH_ADAPT */
-no_guess:
 #endif /* BTR_CUR_ADAPT */
 	btr_cur_n_non_sea++;
 
@@ -548,7 +533,6 @@ no_guess:
 
 	switch (latch_mode) {
 	case BTR_MODIFY_TREE:
-	case BTR_MODIFY_TREE_APPLY_LOG:
 		mtr_x_lock(dict_index_get_lock(index), mtr);
 		break;
 	case BTR_CONT_MODIFY_TREE:
@@ -723,7 +707,7 @@ retry_page_get:
 		cursor->tree_height = root_height + 1;
 
 #ifdef BTR_CUR_ADAPT
-		if (block != guess && info) {
+		if (block != guess) {
 			info->root_guess = block;
 		}
 #endif
@@ -739,7 +723,6 @@ retry_page_get:
 
 		switch (latch_mode) {
 		case BTR_MODIFY_TREE:
-		case BTR_MODIFY_TREE_APPLY_LOG:
 		case BTR_CONT_MODIFY_TREE:
 			break;
 		default:
@@ -815,14 +798,8 @@ retry_page_get:
 		will properly check btr_search_enabled again in
 		btr_search_build_page_hash_index() before building a
 		page hash index, while holding btr_search_latch. */
-		switch (latch_mode) {
-		case BTR_MODIFY_TREE_APPLY_LOG:
-		case BTR_MODIFY_LEAF_APPLY_LOG:
-			break;
-		default:
-			if (btr_search_enabled) {
-				btr_search_info_update(index, cursor);
-			}
+		if (btr_search_enabled) {
+			btr_search_info_update(index, cursor);
 		}
 #endif
 		ut_ad(cursor->up_match != ULINT_UNDEFINED
@@ -883,9 +860,6 @@ btr_cur_open_at_index_side_func(
 	savepoint = mtr_set_savepoint(mtr);
 
 	switch (latch_mode) {
-	case BTR_MODIFY_TREE_APPLY_LOG:
-	case BTR_MODIFY_LEAF_APPLY_LOG:
-		ut_error;
 	case BTR_CONT_MODIFY_TREE:
 		break;
 	case BTR_MODIFY_TREE:
@@ -935,7 +909,6 @@ btr_cur_open_at_index_side_func(
 			switch (latch_mode) {
 			case BTR_MODIFY_TREE:
 			case BTR_CONT_MODIFY_TREE:
-			case BTR_MODIFY_TREE_APPLY_LOG:
 				break;
 			default:
 				/* Release the tree s-latch */
@@ -1012,14 +985,11 @@ btr_cur_open_at_rnd_pos_func(
 	rec_offs_init(offsets_);
 
 	switch (latch_mode) {
-	case BTR_CONT_MODIFY_TREE:
-	case BTR_MODIFY_TREE_APPLY_LOG:
-	case BTR_MODIFY_LEAF_APPLY_LOG:
-		ut_error;
 	case BTR_MODIFY_TREE:
 		mtr_x_lock(dict_index_get_lock(index), mtr);
 		break;
 	default:
+		ut_ad(latch_mode != BTR_CONT_MODIFY_TREE);
 		mtr_s_lock(dict_index_get_lock(index), mtr);
 	}
 

=== modified file 'storage/innobase/btr/btr0sea.cc'
--- a/storage/innobase/btr/btr0sea.cc	revid:marko.makela@stripped5h01ee6pemt6kzrn
+++ b/storage/innobase/btr/btr0sea.cc	revid:marko.makela@strippedfc
@@ -217,15 +217,7 @@ btr_search_disable_ref_count(
 	for (index = dict_table_get_first_index(table); index;
 	     index = dict_table_get_next_index(index)) {
 
-		switch (dict_index_get_online_status(index)) {
-		case ONLINE_INDEX_CREATION:
-		case ONLINE_INDEX_ABORTED:
-		case ONLINE_INDEX_ABORTED_DROPPED:
-			break;
-		case ONLINE_INDEX_COMPLETE:
-			btr_search_get_info(index)->ref_count = 0;
-			break;
-		}
+		index->search_info->ref_count = 0;
 	}
 }
 
@@ -1112,6 +1104,8 @@ retry:
 	ut_a(!dict_index_is_ibuf(index));
 #ifdef UNIV_DEBUG
 	switch (dict_index_get_online_status(index)) {
+	case ONLINE_INDEX_CREATION:
+		/* The index is being created (bulk loaded). */
 	case ONLINE_INDEX_COMPLETE:
 		/* The index has been published. */
 	case ONLINE_INDEX_ABORTED:
@@ -1119,12 +1113,8 @@ retry:
 		error observed by InnoDB (in which case there should
 		not be any adaptive hash index entries), or it was
 		completed and then flagged aborted in
-		rollback_inplace_alter_table(). In the latter case,
-		there could exist adaptive hash index entries. */
+		rollback_inplace_alter_table(). */
 		break;
-	case ONLINE_INDEX_CREATION:
-		/* The adaptive hash index should not be built during
-		online index creation. */
 	case ONLINE_INDEX_ABORTED_DROPPED:
 		/* The index should have been dropped from the tablespace
 		already, and the adaptive hash index entries should have
@@ -1331,7 +1321,6 @@ btr_search_build_page_hash_index(
 
 	ut_ad(index);
 	ut_a(!dict_index_is_ibuf(index));
-	ut_ad(!dict_index_is_online_ddl(index));
 
 #ifdef UNIV_SYNC_DEBUG
 	ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
@@ -1471,7 +1460,7 @@ btr_search_build_page_hash_index(
 	have to take care not to increment the counter in that
 	case. */
 	if (!block->index) {
-		btr_search_get_info(index)->ref_count++;
+		index->search_info->ref_count++;
 	}
 
 	block->n_hash_helps = 0;

=== modified file 'storage/innobase/dict/dict0dict.cc'
--- a/storage/innobase/dict/dict0dict.cc	revid:marko.makela@stripped
+++ b/storage/innobase/dict/dict0dict.cc	revid:marko.makela@strippedm-20120515104310-wqf7uxiqfr9b4dfc
@@ -2217,7 +2217,7 @@ undo_size_ok:
 	UT_LIST_ADD_LAST(indexes, table->indexes, new_index);
 	new_index->table = table;
 	new_index->table_name = table->name;
-	new_index->info.search = btr_search_info_create(new_index->heap);
+	new_index->search_info = btr_search_info_create(new_index->heap);
 
 	new_index->stat_index_size = 1;
 	new_index->stat_n_leaf_pages = 1;
@@ -2286,19 +2286,10 @@ dict_index_remove_from_cache_low(
 
 	rw_lock_x_lock(dict_index_get_lock(index));
 
-	switch (dict_index_get_online_status(index)) {
-	case ONLINE_INDEX_CREATION:
-		if (index->info.online_log) {
-			row_log_free(index);
-		}
-		/* fall through */
-	case ONLINE_INDEX_ABORTED:
-	case ONLINE_INDEX_ABORTED_DROPPED:
-		/* Pretend that the index is complete. */
-		index->online_status = ONLINE_INDEX_COMPLETE;
-		break;
-	case ONLINE_INDEX_COMPLETE:
-		break;
+	if (index->online_log) {
+		ut_ad(dict_index_get_online_status(index)
+		      == ONLINE_INDEX_CREATION);
+		row_log_free(index);
 	}
 
 	rw_lock_x_unlock(dict_index_get_lock(index));

=== modified file 'storage/innobase/include/btr0btr.h'
--- a/storage/innobase/include/btr0btr.h	revid:marko.makela@stripped0120515071932-5h01ee6pemt6kzrn
+++ b/storage/innobase/include/btr0btr.h	revid:marko.makela@stripped10-wqf7uxiqfr9b4dfc
@@ -65,11 +65,7 @@ enum btr_latch_mode {
 	/** Search the previous record. */
 	BTR_SEARCH_PREV = 35,
 	/** Modify the previous record. */
-	BTR_MODIFY_PREV = 36,
-	/** Apply records that were logged during online index creation. */
-	BTR_MODIFY_LEAF_APPLY_LOG = 37,
-	/** Apply records that were logged during online index creation. */
-	BTR_MODIFY_TREE_APPLY_LOG = 38
+	BTR_MODIFY_PREV = 36
 };
 
 /* BTR_INSERT, BTR_DELETE and BTR_DELETE_MARK are mutually exclusive. */

=== modified file 'storage/innobase/include/btr0sea.h'
--- a/storage/innobase/include/btr0sea.h	revid:marko.makela@stripped5071932-5h01ee6pemt6kzrn
+++ b/storage/innobase/include/btr0sea.h	revid:marko.makela@stripped7uxiqfr9b4dfc
@@ -68,7 +68,8 @@ UNIV_INLINE
 btr_search_t*
 btr_search_get_info(
 /*================*/
-	dict_index_t*	index);	/*!< in: index */
+	dict_index_t*	index)	/*!< in: index */
+	__attribute__((nonnull));
 /*****************************************************************//**
 Creates and initializes a search info struct.
 @return	own: search info struct */

=== modified file 'storage/innobase/include/btr0sea.ic'
--- a/storage/innobase/include/btr0sea.ic	revid:marko.makela@stripped5h01ee6pemt6kzrn
+++ b/storage/innobase/include/btr0sea.ic	revid:marko.makela@stripped9b4dfc
@@ -45,10 +45,7 @@ btr_search_get_info(
 /*================*/
 	dict_index_t*	index)	/*!< in: index */
 {
-	ut_ad(index);
-	ut_ad(!dict_index_is_online_ddl(index));
-
-	return(index->info.search);
+	return(index->search_info);
 }
 
 /*********************************************************************//**

=== modified file 'storage/innobase/include/dict0mem.h'
--- a/storage/innobase/include/dict0mem.h	revid:marko.makela@stripped32-5h01ee6pemt6kzrn
+++ b/storage/innobase/include/dict0mem.h	revid:marko.makela@strippedqfr9b4dfc
@@ -491,18 +491,13 @@ struct dict_index_struct{
 #ifndef UNIV_HOTBACKUP
 	UT_LIST_NODE_T(dict_index_t)
 			indexes;/*!< list of indexes of the table */
-	union {
-		btr_search_t*	search; /*!< info used in optimistic searches;
-					valid when online_status is one of
-					ONLINE_INDEX_COMPLETE,
-					ONLINE_INDEX_ABORTED,
-					ONLINE_INDEX_ABORTED_DROPPED */
-		row_log_t*	online_log;
-					/*!< the log of modifications
-					during online index creation;
-					valid when online_status is
-					ONLINE_INDEX_CREATION */
-	} info;
+	btr_search_t*	search_info;
+				/*!< info used in optimistic searches */
+	row_log_t*	online_log;
+				/*!< the log of modifications
+				during online index creation;
+				valid when online_status is
+				ONLINE_INDEX_CREATION */
 	/*----------------------*/
 	/** Statistics for query optimization */
 	/* @{ */

=== modified file 'storage/innobase/row/row0ins.cc'
--- a/storage/innobase/row/row0ins.cc	revid:marko.makela@stripped
+++ b/storage/innobase/row/row0ins.cc	revid:marko.makela@stripped0120515104310-wqf7uxiqfr9b4dfc
@@ -2187,8 +2187,9 @@ row_ins_clust_index_entry_low(
 		err = row_ins_duplicate_error_in_clust(
 			&cursor, entry, thr, &mtr);
 		if (err != DB_SUCCESS) {
-
-			goto function_exit;
+err_exit:
+			mtr_commit(&mtr);
+			return(err);
 		}
 	}
 
@@ -2260,44 +2261,44 @@ row_ins_clust_index_entry_low(
 			the following assertion failure will
 			effectively "roll back" the operation. */
 			ut_a(err == DB_SUCCESS);
-			mtr_commit(&mtr);
 			dtuple_big_rec_free(big_rec);
-			goto stored_big_rec;
 		}
+
+		mtr_commit(&mtr);
 	} else {
 		rec_t*	insert_rec;
 
-		if (mode == BTR_MODIFY_LEAF) {
+		if (mode != BTR_MODIFY_TREE) {
+			ut_ad(mode == BTR_MODIFY_LEAF);
 			err = btr_cur_optimistic_insert(
 				0, &cursor, entry, &insert_rec, &big_rec,
 				n_ext, thr, &mtr);
 		} else {
-			ut_ad(mode == BTR_MODIFY_TREE);
 			if (buf_LRU_buf_pool_running_out()) {
 
 				err = DB_LOCK_TABLE_FULL;
-
-				goto function_exit;
+				goto err_exit;
 			}
 			err = btr_cur_pessimistic_insert(
 				0, &cursor, entry, &insert_rec, &big_rec,
 				n_ext, thr, &mtr);
 		}
-	}
 
-function_exit:
-	mtr_commit(&mtr);
+		mtr_commit(&mtr);
 
-	if (UNIV_LIKELY_NULL(big_rec)) {
-		DBUG_EXECUTE_IF(
-			"row_ins_extern_checkpoint",
-			log_make_checkpoint_at(IB_ULONGLONG_MAX, TRUE););
-		err = row_ins_index_entry_big_rec(
-			entry, big_rec, NULL, &heap, index,
-			thr_get_trx(thr)->mysql_thd, __FILE__, __LINE__);
-		dtuple_convert_back_big_rec(index, entry, big_rec);
+		if (UNIV_LIKELY_NULL(big_rec)) {
+			DBUG_EXECUTE_IF(
+				"row_ins_extern_checkpoint",
+				log_make_checkpoint_at(
+					IB_ULONGLONG_MAX, TRUE););
+			err = row_ins_index_entry_big_rec(
+				entry, big_rec, NULL, &heap, index,
+				thr_get_trx(thr)->mysql_thd,
+				__FILE__, __LINE__);
+			dtuple_convert_back_big_rec(index, entry, big_rec);
+		}
 	}
-stored_big_rec:
+
 	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}

=== modified file 'storage/innobase/row/row0log.cc'
--- a/storage/innobase/row/row0log.cc	revid:marko.makela@stripped71932-5h01ee6pemt6kzrn
+++ b/storage/innobase/row/row0log.cc	revid:marko.makela@strippedfr9b4dfc
@@ -76,7 +76,6 @@ struct row_log_struct {
 	row_log_buf_t	head;	/*!< reader context; protected by MDL only;
 				modifiable by row_log_apply_ops() */
 	ulint		size;	/*!< allocated size */
-	btr_search_t*	search; /*!< old content of index->info.search */
 };
 
 /******************************************************//**
@@ -124,13 +123,13 @@ op_ok:
 	}
 
 	ut_ad(dict_index_is_online_ddl(index));
-	mutex_enter(&index->info.online_log->mutex);
+	mutex_enter(&index->online_log->mutex);
 
-	if (trx_id > index->info.online_log->max_trx) {
-		index->info.online_log->max_trx = trx_id;
+	if (trx_id > index->online_log->max_trx) {
+		index->online_log->max_trx = trx_id;
 	}
 
-	log = index->info.online_log;
+	log = index->online_log;
 	UNIV_MEM_INVALID(log->tail.buf, sizeof log->tail.buf);
 
 	/* Compute the size of the record. This differs from
@@ -194,7 +193,7 @@ op_ok:
 		UNIV_MEM_ASSERT_RW(log->tail.block, srv_sort_buf_size);
 		ret = os_file_write(
 			"(modification log)",
-			OS_FILE_FROM_FD(index->info.online_log->fd),
+			OS_FILE_FROM_FD(index->online_log->fd),
 			log->tail.block, byte_offset, srv_sort_buf_size);
 		log->tail.blocks++;
 		if (!ret) {
@@ -214,7 +213,7 @@ write_failed:
 	}
 
 	UNIV_MEM_INVALID(log->tail.buf, sizeof log->tail.buf);
-	mutex_exit(&index->info.online_log->mutex);
+	mutex_exit(&index->online_log->mutex);
 }
 
 /******************************************************//**
@@ -251,9 +250,8 @@ row_log_allocate(
 	log->tail.block = buf + srv_sort_buf_size;
 	log->tail.blocks = log->tail.bytes = 0;
 	log->head.blocks = log->head.bytes = 0;
-	log->search = index->info.search;
 	dict_index_set_online_status(index, ONLINE_INDEX_CREATION);
-	index->info.online_log = log;
+	index->online_log = log;
 
 	/* While we might be holding an exclusive data dictionary lock
 	here, in row_log_free() we will not always be holding it. Use
@@ -286,15 +284,12 @@ row_log_free(
 /*=========*/
 	dict_index_t*	index)	/*!< in/out: index (x-latched) */
 {
-	row_log_t*	log;
-
 #ifdef UNIV_SYNC_DEBUG
 	ut_ad(rw_lock_own(dict_index_get_lock(index), RW_LOCK_EX));
 #endif /* UNIV_SYNC_DEBUG */
 	dict_index_set_online_status(index, ONLINE_INDEX_ABORTED);
-	log = index->info.online_log;
-	index->info.search = log->search;
-	row_log_free_low(log);
+	row_log_free_low(index->online_log);
+	index->online_log = NULL;
 }
 
 /******************************************************//**
@@ -310,10 +305,10 @@ row_log_get_max_trx(
 	ut_ad(dict_index_get_online_status(index) == ONLINE_INDEX_CREATION);
 #ifdef UNIV_SYNC_DEBUG
 	ut_ad((rw_lock_own(dict_index_get_lock(index), RW_LOCK_SHARED)
-	       && mutex_own(&index->info.online_log->mutex))
+	       && mutex_own(&index->online_log->mutex))
 	      || rw_lock_own(dict_index_get_lock(index), RW_LOCK_EX));
 #endif /* UNIV_SYNC_DEBUG */
-	return(index->info.online_log->max_trx);
+	return(index->online_log->max_trx);
 }
 
 /******************************************************//**
@@ -354,8 +349,8 @@ row_log_apply_op_low(
 	scanned. */
 	btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
 				    has_index_lock
-				    ? BTR_MODIFY_TREE_APPLY_LOG
-				    : BTR_MODIFY_LEAF_APPLY_LOG,
+				    ? BTR_MODIFY_TREE
+				    : BTR_MODIFY_LEAF,
 				    &cursor, 0, __FILE__, __LINE__,
 				    &mtr);
 
@@ -410,9 +405,8 @@ row_log_apply_op_low(
 				mtr_start(&mtr);
 				btr_cur_search_to_nth_level(
 					index, 0, entry, PAGE_CUR_LE,
-					BTR_MODIFY_TREE_APPLY_LOG,
-					&cursor, 0, __FILE__, __LINE__,
-					&mtr);
+					BTR_MODIFY_TREE, &cursor, 0,
+					__FILE__, __LINE__, &mtr);
 
 				/* No other thread than the current one
 				is allowed to modify the index tree.
@@ -497,8 +491,7 @@ update_the_rec:
 				mtr_start(&mtr);
 				btr_cur_search_to_nth_level(
 					index, 0, entry, PAGE_CUR_LE,
-					BTR_MODIFY_TREE_APPLY_LOG,
-					&cursor, 0,
+					BTR_MODIFY_TREE, &cursor, 0,
 					__FILE__, __LINE__, &mtr);
 				/* No other thread than the
 				current one is allowed to
@@ -569,8 +562,7 @@ insert_the_rec:
 				mtr_start(&mtr);
 				btr_cur_search_to_nth_level(
 					index, 0, entry, PAGE_CUR_LE,
-					BTR_MODIFY_TREE_APPLY_LOG,
-					&cursor, 0,
+					BTR_MODIFY_TREE, &cursor, 0,
 					__FILE__, __LINE__, &mtr);
 				/* We already determined that the
 				record did not exist. No other thread
@@ -756,7 +748,7 @@ row_log_apply_ops(
 #ifdef UNIV_SYNC_DEBUG
 	ut_ad(rw_lock_own(dict_index_get_lock(index), RW_LOCK_EX));
 #endif /* UNIV_SYNC_DEBUG */
-	ut_ad(index->info.online_log);
+	ut_ad(index->online_log);
 	UNIV_MEM_INVALID(&mrec_end, sizeof mrec_end);
 
 	offsets = static_cast<ulint*>(ut_malloc(i * sizeof *offsets));
@@ -771,7 +763,7 @@ next_block:
 #ifdef UNIV_SYNC_DEBUG
 	ut_ad(rw_lock_own(dict_index_get_lock(index), RW_LOCK_EX));
 #endif /* UNIV_SYNC_DEBUG */
-	ut_ad(index->info.online_log->head.bytes == 0);
+	ut_ad(index->online_log->head.bytes == 0);
 
 	if (trx_is_interrupted(trx)) {
 		goto interrupted;
@@ -782,8 +774,8 @@ next_block:
 		goto func_exit;
 	}
 
-	if (UNIV_UNLIKELY(index->info.online_log->head.blocks
-			  > index->info.online_log->tail.blocks)) {
+	if (UNIV_UNLIKELY(index->online_log->head.blocks
+			  > index->online_log->tail.blocks)) {
 unexpected_eof:
 		fprintf(stderr, "InnoDB: unexpected end of temporary file"
 			" for index %s\n", index->name + 1);
@@ -792,26 +784,26 @@ corruption:
 		goto func_exit;
 	}
 
-	if (index->info.online_log->head.blocks
-	    == index->info.online_log->tail.blocks) {
-		if (index->info.online_log->head.blocks) {
+	if (index->online_log->head.blocks
+	    == index->online_log->tail.blocks) {
+		if (index->online_log->head.blocks) {
 #ifdef HAVE_FTRUNCATE
 			/* Truncate the file in order to save space. */
-			ftruncate(index->info.online_log->fd, 0);
+			ftruncate(index->online_log->fd, 0);
 #endif /* HAVE_FTRUNCATE */
-			index->info.online_log->head.blocks
-				= index->info.online_log->tail.blocks = 0;
+			index->online_log->head.blocks
+				= index->online_log->tail.blocks = 0;
 		}
 
-		next_mrec = index->info.online_log->tail.block;
-		next_mrec_end = next_mrec + index->info.online_log->tail.bytes;
+		next_mrec = index->online_log->tail.block;
+		next_mrec_end = next_mrec + index->online_log->tail.bytes;
 
 		if (next_mrec_end == next_mrec) {
 			/* End of log reached. */
 all_done:
 			ut_ad(has_index_lock);
-			ut_ad(index->info.online_log->head.blocks == 0);
-			ut_ad(index->info.online_log->tail.blocks == 0);
+			ut_ad(index->online_log->head.blocks == 0);
+			ut_ad(index->online_log->tail.blocks == 0);
 			error = DB_SUCCESS;
 			goto func_exit;
 		}
@@ -819,7 +811,7 @@ all_done:
 		os_offset_t	ofs;
 		ibool		success;
 
-		ofs = (os_offset_t) index->info.online_log->head.blocks
+		ofs = (os_offset_t) index->online_log->head.blocks
 			* srv_sort_buf_size;
 
 		if (has_index_lock) {
@@ -830,8 +822,8 @@ all_done:
 		log_free_check();
 
 		success = os_file_read_no_error_handling(
-			OS_FILE_FROM_FD(index->info.online_log->fd),
-			index->info.online_log->head.block, ofs,
+			OS_FILE_FROM_FD(index->online_log->fd),
+			index->online_log->head.block, ofs,
 			srv_sort_buf_size);
 
 		if (!success) {
@@ -842,19 +834,19 @@ all_done:
 
 #ifdef POSIX_FADV_DONTNEED
 		/* Each block is read exactly once.  Free up the file cache. */
-		posix_fadvise(index->info.online_log->fd,
+		posix_fadvise(index->online_log->fd,
 			      ofs, srv_sort_buf_size, POSIX_FADV_DONTNEED);
 #endif /* POSIX_FADV_DONTNEED */
 #ifdef FALLOC_FL_PUNCH_HOLE
 		/* Try to deallocate the space for the file on disk.
 		This should work on ext4 on Linux 2.6.39 and later,
 		and be ignored when the operation is unsupported. */
-		fallocate(index->info.online_log->fd,
+		fallocate(index->online_log->fd,
 			  FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
 			  ofs, srv_buf_size);
 #endif /* FALLOC_FL_PUNCH_HOLE */
 
-		next_mrec = index->info.online_log->head.block;
+		next_mrec = index->online_log->head.block;
 		next_mrec_end = next_mrec + srv_sort_buf_size;
 	}
 
@@ -862,19 +854,19 @@ all_done:
 		/* A partial record was read from the previous block.
 		Copy the temporary buffer full, as we do not know the
 		length of the record. Parse subsequent records from
-		the bigger buffer index->info.online_log->head.block
-		or index->info.online_log->tail.block. */
+		the bigger buffer index->online_log->head.block
+		or index->online_log->tail.block. */
 
-		ut_ad(mrec == index->info.online_log->head.buf);
+		ut_ad(mrec == index->online_log->head.buf);
 		ut_ad(mrec_end > mrec);
-		ut_ad(mrec_end < (&index->info.online_log->head.buf)[1]);
+		ut_ad(mrec_end < (&index->online_log->head.buf)[1]);
 
 		memcpy((mrec_t*) mrec_end, next_mrec,
-		       (&index->info.online_log->head.buf)[1] - mrec_end);
+		       (&index->online_log->head.buf)[1] - mrec_end);
 		mrec = row_log_apply_op(
 			index, dup, &error, heap, has_index_lock,
-			index->info.online_log->head.buf,
-			(&index->info.online_log->head.buf)[1], offsets);
+			index->online_log->head.buf,
+			(&index->online_log->head.buf)[1], offsets);
 		if (error != DB_SUCCESS) {
 			goto func_exit;
 		} else if (UNIV_UNLIKELY(mrec == NULL)) {
@@ -886,8 +878,8 @@ all_done:
 		it should proceed beyond the old end of the buffer. */
 		ut_a(mrec > mrec_end);
 
-		index->info.online_log->head.bytes = mrec - mrec_end;
-		next_mrec += index->info.online_log->head.bytes;
+		index->online_log->head.bytes = mrec - mrec_end;
+		next_mrec += index->online_log->head.bytes;
 	}
 
 	ut_ad(next_mrec <= next_mrec_end);
@@ -896,32 +888,32 @@ all_done:
 
 	/* mrec!=NULL means that the next record starts from the
 	middle of the block */
-	ut_ad((mrec == NULL) == (index->info.online_log->head.bytes == 0));
+	ut_ad((mrec == NULL) == (index->online_log->head.bytes == 0));
 
 #ifdef UNIV_DEBUG
-	if (next_mrec_end == index->info.online_log->head.block
+	if (next_mrec_end == index->online_log->head.block
 	    + srv_sort_buf_size) {
 		/* If tail.bytes == 0, next_mrec_end can also be at
 		the end of tail.block. */
-		if (index->info.online_log->tail.bytes == 0) {
+		if (index->online_log->tail.bytes == 0) {
 			ut_ad(next_mrec == next_mrec_end);
-			ut_ad(index->info.online_log->tail.blocks == 0);
-			ut_ad(index->info.online_log->head.blocks == 0);
-			ut_ad(index->info.online_log->head.bytes == 0);
+			ut_ad(index->online_log->tail.blocks == 0);
+			ut_ad(index->online_log->head.blocks == 0);
+			ut_ad(index->online_log->head.bytes == 0);
 		} else {
-			ut_ad(next_mrec == index->info.online_log->head.block
-			      + index->info.online_log->head.bytes);
-			ut_ad(index->info.online_log->tail.blocks
-			      > index->info.online_log->head.blocks);
-		}
-	} else if (next_mrec_end == index->info.online_log->tail.block
-		   + index->info.online_log->tail.bytes) {
-		ut_ad(next_mrec == index->info.online_log->tail.block
-		      + index->info.online_log->head.bytes);
-		ut_ad(index->info.online_log->tail.blocks == 0);
-		ut_ad(index->info.online_log->head.blocks == 0);
-		ut_ad(index->info.online_log->head.bytes
-		      <= index->info.online_log->tail.bytes);
+			ut_ad(next_mrec == index->online_log->head.block
+			      + index->online_log->head.bytes);
+			ut_ad(index->online_log->tail.blocks
+			      > index->online_log->head.blocks);
+		}
+	} else if (next_mrec_end == index->online_log->tail.block
+		   + index->online_log->tail.bytes) {
+		ut_ad(next_mrec == index->online_log->tail.block
+		      + index->online_log->head.bytes);
+		ut_ad(index->online_log->tail.blocks == 0);
+		ut_ad(index->online_log->head.blocks == 0);
+		ut_ad(index->online_log->head.bytes
+		      <= index->online_log->tail.bytes);
 	} else {
 		ut_error;
 	}
@@ -939,10 +931,10 @@ all_done:
 			Release and reacquire index->lock in order to
 			allow other threads to concurrently buffer
 			modifications. */
-			ut_ad(mrec >= index->info.online_log->head.block);
-			ut_ad(mrec_end == index->info.online_log->head.block
+			ut_ad(mrec >= index->online_log->head.block);
+			ut_ad(mrec_end == index->online_log->head.block
 			      + srv_sort_buf_size);
-			ut_ad(index->info.online_log->head.bytes
+			ut_ad(index->online_log->head.bytes
 			      < srv_sort_buf_size);
 
 			/* Take the opportunity to do a redo log
@@ -952,11 +944,11 @@ all_done:
 			/* We are applying operations from the last block.
 			Do not allow other threads to buffer anything,
 			so that we can finally catch up and synchronize. */
-			ut_ad(index->info.online_log->head.blocks == 0);
-			ut_ad(index->info.online_log->tail.blocks == 0);
-			ut_ad(mrec_end == index->info.online_log->tail.block
-			      + index->info.online_log->tail.bytes);
-			ut_ad(mrec >= index->info.online_log->tail.block);
+			ut_ad(index->online_log->head.blocks == 0);
+			ut_ad(index->online_log->tail.blocks == 0);
+			ut_ad(mrec_end == index->online_log->tail.block
+			      + index->online_log->tail.bytes);
+			ut_ad(mrec >= index->online_log->tail.block);
 		}
 
 		next_mrec = row_log_apply_op(
@@ -979,26 +971,26 @@ process_next_block:
 			rw_lock_x_lock(dict_index_get_lock(index));
 			has_index_lock = TRUE;
 
-			index->info.online_log->head.bytes = 0;
-			index->info.online_log->head.blocks++;
+			index->online_log->head.bytes = 0;
+			index->online_log->head.blocks++;
 			goto next_block;
 		} else if (next_mrec != NULL) {
 			ut_ad(next_mrec < next_mrec_end);
-			index->info.online_log->head.bytes += next_mrec - mrec;
+			index->online_log->head.bytes += next_mrec - mrec;
 		} else if (has_index_lock) {
 			/* When mrec is within tail.block, it should
 			be a complete record, because we are holding
 			index->lock and thus excluding the writer. */
-			ut_ad(index->info.online_log->tail.blocks == 0);
-			ut_ad(mrec_end == index->info.online_log->tail.block
-			      + index->info.online_log->tail.bytes);
+			ut_ad(index->online_log->tail.blocks == 0);
+			ut_ad(mrec_end == index->online_log->tail.block
+			      + index->online_log->tail.bytes);
 			ut_ad(0);
 			goto unexpected_eof;
 		} else {
-			memcpy(index->info.online_log->head.buf, mrec,
+			memcpy(index->online_log->head.buf, mrec,
 			       mrec_end - mrec);
-			mrec_end += index->info.online_log->head.buf - mrec;
-			mrec = index->info.online_log->head.buf;
+			mrec_end += index->online_log->head.buf - mrec;
+			mrec = index->online_log->head.buf;
 			goto process_next_block;
 		}
 	}
@@ -1014,7 +1006,7 @@ func_exit:
 	case DB_SUCCESS:
 		break;
 	case DB_INDEX_CORRUPT:
-		if (((os_offset_t) index->info.online_log->tail.blocks + 1)
+		if (((os_offset_t) index->online_log->tail.blocks + 1)
 		    * srv_sort_buf_size >= srv_online_max_size) {
 			/* The log file grew too big. */
 			error = DB_ONLINE_LOG_TOO_BIG;
@@ -1076,8 +1068,8 @@ row_log_apply(
 		dict_index_set_online_status(index, ONLINE_INDEX_COMPLETE);
 	}
 
-	log = index->info.online_log;
-	index->info.search = log->search;
+	log = index->online_log;
+	index->online_log = NULL;
 	/* We could remove the TEMP_INDEX_PREFIX and update the data
 	dictionary to say that this index is complete, if we had
 	access to the .frm file here.  If the server crashes before

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