List:Commits« Previous MessageNext Message »
From:kevin.lewis Date:May 28 2012 3:12pm
Subject:bzr push into mysql-trunk branch (kevin.lewis:3906 to 3907)
View as plain text  
 3907 kevin.lewis@stripped	2012-05-28
      Review edits requested by Sunny and Jimmy.
      A fix for the failing innodb-index-online.test

    modified:
      mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test
      storage/innobase/dict/dict0crea.cc
      storage/innobase/dict/dict0load.cc
      storage/innobase/fil/fil0fil.cc
      storage/innobase/fts/fts0fts.cc
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/handler/handler0alter.cc
      storage/innobase/include/dict0crea.h
      storage/innobase/include/row0mysql.h
      storage/innobase/pars/pars0pars.cc
      storage/innobase/row/row0merge.cc
      storage/innobase/row/row0mysql.cc
 3906 kevin.lewis@stripped	2012-05-27
      Fix innodb-multiple-tablespaces better

    modified:
      mysql-test/suite/innodb/r/innodb-multiple-tablespaces.result
=== modified file 'mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test'
--- a/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test	revid:kevin.lewis@stripped
+++ b/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test	revid:kevin.lewis@stripped
@@ -313,7 +313,7 @@ DROP TABLE nolink;
 --echo # the data dictionary in order to determine if the table it is
 --echo # openeing is the correct one, or to finde the previous location
 --echo # of a tablespace from SYS_DATAFILES.  It must rely on the ISL file
---echo # to tell the truth. But it can compare the current linked location 
+--echo # to tell the truth. But it can compare the current linked location
 --echo # with a tablespace found in the default location and use the most
 --echo # recent.
 --echo #
@@ -407,19 +407,19 @@ COMMIT;
 
 --echo # AA; Control table, used as the source of 'wrong' tablespaces and opened first during recovery.
 
---echo # YN; Tablespace found the default directory but not in alt_dir 
---copy_file $MYSQL_TMP_DIR/alt_dir/test/yn.ibd $MYSQLD_DATADIR/test/yn.ibd 
+--echo # YN; Tablespace found the default directory but not in alt_dir.
+--copy_file $MYSQL_TMP_DIR/alt_dir/test/yn.ibd $MYSQLD_DATADIR/test/yn.ibd
 --remove_file $MYSQL_TMP_DIR/alt_dir/test/yn.ibd
 
 --echo # NY; Tablespace found in alt_dir but not the default directory.
 
 --echo # YW; Tablespace found in the default directory but the wrong file in alt_dir
---copy_file $MYSQL_TMP_DIR/alt_dir/test/yw.ibd $MYSQLD_DATADIR/test/yw.ibd 
+--copy_file $MYSQL_TMP_DIR/alt_dir/test/yw.ibd $MYSQLD_DATADIR/test/yw.ibd
 --remove_file $MYSQL_TMP_DIR/alt_dir/test/yw.ibd
---copy_file $MYSQLD_DATADIR/test/aa.ibd $MYSQL_TMP_DIR/alt_dir/test/yw.ibd 
+--copy_file $MYSQLD_DATADIR/test/aa.ibd $MYSQL_TMP_DIR/alt_dir/test/yw.ibd
 
---echo # WY; The wrong tablespace found in the default directory and the corect one in alt_dir 
---copy_file $MYSQLD_DATADIR/test/aa.ibd $MYSQLD_DATADIR/test/wy.ibd 
+--echo # WY; The wrong tablespace found in the default directory and the corect one in alt_dir
+--copy_file $MYSQLD_DATADIR/test/aa.ibd $MYSQLD_DATADIR/test/wy.ibd
 
 --echo ---- MYSQLD_DATADIR/test
 --replace_regex  /#P#/#p#/  /#SP#/#sp#/

=== modified file 'storage/innobase/dict/dict0crea.cc'
--- a/storage/innobase/dict/dict0crea.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/dict/dict0crea.cc	revid:kevin.lewis@stripped
@@ -911,7 +911,9 @@ tab_create_graph_create(
 /*====================*/
 	dict_table_t*	table,	/*!< in: table to create, built as a memory data
 				structure */
-	mem_heap_t*	heap)	/*!< in: heap where created */
+	mem_heap_t*	heap,	/*!< in: heap where created */
+	bool		commit)	/*!< in: true if the commit node should be
+				added to the query graph */
 {
 	tab_node_t*	node;
 
@@ -933,8 +935,12 @@ tab_create_graph_create(
 					heap);
 	node->col_def->common.parent = node;
 
-	node->commit_node = trx_commit_node_create(heap);
-	node->commit_node->common.parent = node;
+	if (commit) {
+		node->commit_node = trx_commit_node_create(heap);
+		node->commit_node->common.parent = node;
+	} else {
+		node->commit_node = 0;
+	}
 
 	return(node);
 }
@@ -948,7 +954,9 @@ ind_create_graph_create(
 /*====================*/
 	dict_index_t*	index,	/*!< in: index to create, built as a memory data
 				structure */
-	mem_heap_t*	heap)	/*!< in: heap where created */
+	mem_heap_t*	heap,	/*!< in: heap where created */
+	bool		commit)	/*!< in: true if the commit node should be
+				added to the query graph */
 {
 	ind_node_t*	node;
 
@@ -971,8 +979,12 @@ ind_create_graph_create(
 					  dict_sys->sys_fields, heap);
 	node->field_def->common.parent = node;
 
-	node->commit_node = trx_commit_node_create(heap);
-	node->commit_node->common.parent = node;
+	if (commit) {
+		node->commit_node = trx_commit_node_create(heap);
+		node->commit_node->common.parent = node;
+	} else {
+		node->commit_node = 0;
+	}
 
 	return(node);
 }
@@ -1213,7 +1225,8 @@ move it to the non-LRU end of the table 
 for system tables that can be upgraded or added to an older database,
 which include SYS_FOREIGN, SYS_FOREIGN_COLS, SYS_TABLESPACES and
 SYS_DATAFILES.
-@return TRUE if they exist. */
+@return DB_SUCCESS if the sys table exists, DB_CORRUPTION if it exists
+but is not current, DB_TABLE_NOT_FOUND if it does not exist*/
 static
 dberr_t
 dict_check_if_system_table_exists(
@@ -1243,8 +1256,6 @@ dict_check_if_system_table_exists(
 		Ensure that it can't be evicted from the table LRU cache. */
 
 		dict_table_move_from_lru_to_non_lru(sys_table);
-
-		error = DB_SUCCESS;
 	}
 
 	mutex_exit(&dict_sys->mutex);
@@ -1746,7 +1757,9 @@ dict_create_add_tablespace_to_dictionary
 	const char*	name,		/*!< in: tablespace name */
 	ulint		flags,		/*!< in: tablespace flags */
 	const char*	path,		/*!< in: tablespace path */
-	trx_t*		trx)		/*!< in/out: transaction */
+	trx_t*		trx,		/*!< in/out: transaction */
+	bool		commit)		/*!< in: if true then commit the
+					transaction */
 {
 	dberr_t		error;
 
@@ -1776,9 +1789,10 @@ dict_create_add_tablespace_to_dictionary
 		return(error);
 	}
 
-	trx->op_info = "committing tablespace and datafile definition";
-
-	trx_commit(trx);
+	if (commit) {
+		trx->op_info = "committing tablespace and datafile definition";
+		trx_commit(trx);
+	}
 
 	trx->op_info = "";
 

=== modified file 'storage/innobase/dict/dict0load.cc'
--- a/storage/innobase/dict/dict0load.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/dict/dict0load.cc	revid:kevin.lewis@stripped
@@ -935,7 +935,7 @@ dict_insert_tablespace_and_filepath(
 	SYS_DATAFILES. Assume the record is also missing in
 	SYS_TABLESPACES.  Insert records onto them both. */
 	err = dict_create_add_tablespace_to_dictionary(
-		space, name, fsp_flags, filepath, trx);
+		space, name, fsp_flags, filepath, trx, false);
 
 	trx_commit_for_mysql(trx);
 	trx_free_for_background(trx);

=== modified file 'storage/innobase/fil/fil0fil.cc'
--- a/storage/innobase/fil/fil0fil.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/fil/fil0fil.cc	revid:kevin.lewis@stripped
@@ -3432,8 +3432,7 @@ error_exit_3:
 
 #ifndef UNIV_HOTBACKUP
 /********************************************************************//**
-Report information about a bad tablespace.
-@return	TRUE if success */
+Report information about a bad tablespace. */
 static
 void
 fil_report_bad_tablespace(
@@ -3880,8 +3879,7 @@ fil_validate_single_table_tablespace(
 
 /********************************************************************//**
 Opens an .ibd file and adds the associated single-table tablespace to the
-InnoDB fil0fil.cc data structures.
-@return	TRUE if tablespace is valid, FALSE if not. */
+InnoDB fil0fil.cc data structures. */
 static
 void
 fil_load_single_table_tablespace(

=== modified file 'storage/innobase/fts/fts0fts.cc'
--- a/storage/innobase/fts/fts0fts.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/fts/fts0fts.cc	revid:kevin.lewis@stripped
@@ -1840,7 +1840,7 @@ fts_create_one_index_table(
 	dict_mem_table_add_col(new_table, heap, "ilist", DATA_BLOB,
 			       4130048,	0);
 
-	error = row_create_table_for_mysql(new_table, trx);
+	error = row_create_table_for_mysql(new_table, trx, true);
 
 	if (error != DB_SUCCESS) {
 		trx->error_state = error;

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/handler/ha_innodb.cc	revid:kevin.lewis@stripped
@@ -8438,7 +8438,7 @@ err_col:
 		fts_add_doc_id_column(table, heap);
 	}
 
-	err = row_create_table_for_mysql(table, trx);
+	err = row_create_table_for_mysql(table, trx, true);
 
 	mem_heap_free(heap);
 

=== modified file 'storage/innobase/handler/handler0alter.cc'
--- a/storage/innobase/handler/handler0alter.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/handler/handler0alter.cc	revid:kevin.lewis@stripped
@@ -1595,7 +1595,7 @@ col_fail:
 			ut_ad(fts_doc_id_col == altered_table->s->fields);
 		}
 
-		error = row_create_table_for_mysql(indexed_table, trx);
+		error = row_create_table_for_mysql(indexed_table, trx, false);
 
 		switch (error) {
 			dict_table_t*	temp_table;
@@ -1655,6 +1655,7 @@ col_fail:
 
 		add_index[num_created] = row_merge_create_index(
 			trx, indexed_table, &index_defs[num_created]);
+
 		add_key_nums[num_created] = index_defs[num_created].key_number;
 
 		if (!add_index[num_created]) {

=== modified file 'storage/innobase/include/dict0crea.h'
--- a/storage/innobase/include/dict0crea.h	revid:kevin.lewis@stripped
+++ b/storage/innobase/include/dict0crea.h	revid:kevin.lewis@stripped
@@ -42,7 +42,9 @@ tab_create_graph_create(
 /*====================*/
 	dict_table_t*	table,	/*!< in: table to create, built as a memory data
 				structure */
-	mem_heap_t*	heap);	/*!< in: heap where created */
+	mem_heap_t*	heap,	/*!< in: heap where created */
+	bool		commit);/*!< in: true if the commit node should be
+				added to the query graph */
 /*********************************************************************//**
 Creates an index create graph.
 @return	own: index create node */
@@ -52,7 +54,9 @@ ind_create_graph_create(
 /*====================*/
 	dict_index_t*	index,	/*!< in: index to create, built as a memory data
 				structure */
-	mem_heap_t*	heap);	/*!< in: heap where created */
+	mem_heap_t*	heap,	/*!< in: heap where created */
+	bool		commit);/*!< in: true if the commit node should be
+				added to the query graph */
 /***********************************************************//**
 Creates a table. This is a high-level function used in SQL execution graphs.
 @return	query thread to run next or NULL */
@@ -150,7 +154,9 @@ dict_create_add_tablespace_to_dictionary
 	const char*	name,		/*!< in: tablespace name */
 	ulint		flags,		/*!< in: tablespace flags */
 	const char*	path,		/*!< in: tablespace path */
-	trx_t*		trx);		/*!< in: transaction */
+	trx_t*		trx,		/*!< in: transaction */
+	bool		commit);	/*!< in: if true then commit the
+					transaction */
 /********************************************************************//**
 Table create node structure */
 struct tab_node_struct{

=== modified file 'storage/innobase/include/row0mysql.h'
--- a/storage/innobase/include/row0mysql.h	revid:kevin.lewis@stripped
+++ b/storage/innobase/include/row0mysql.h	revid:kevin.lewis@stripped
@@ -363,7 +363,8 @@ Creates a table for MySQL. If the name o
 one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
 "innodb_table_monitor", then this will also start the printing of monitor
 output by the master thread. If the table name ends in "innodb_mem_validate",
-InnoDB will try to invoke mem_validate().
+InnoDB will try to invoke mem_validate(). On failure the transaction will
+be rolled back.
 @return	error code or DB_SUCCESS */
 UNIV_INTERN
 dberr_t
@@ -372,7 +373,8 @@ row_create_table_for_mysql(
 	dict_table_t*	table,	/*!< in, own: table definition
 				(will be freed, or on DB_SUCCESS
 				added to the data dictionary cache) */
-	trx_t*		trx)	/*!< in/out: transaction */
+	trx_t*		trx,	/*!< in/out: transaction */
+	bool		commit)	/*!< in: if true, commit the transaction */
 	__attribute__((nonnull, warn_unused_result));
 /*********************************************************************//**
 Does an index creation operation for MySQL. TODO: currently failure

=== modified file 'storage/innobase/pars/pars0pars.cc'
--- a/storage/innobase/pars/pars0pars.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/pars/pars0pars.cc	revid:kevin.lewis@stripped
@@ -2000,7 +2000,7 @@ pars_create_table(
 		column = static_cast<sym_node_t*>(que_node_get_next(column));
 	}
 
-	node = tab_create_graph_create(table, pars_sym_tab_global->heap);
+	node = tab_create_graph_create(table, pars_sym_tab_global->heap, true);
 
 	table_sym->resolved = TRUE;
 	table_sym->token_type = SYM_TABLE;
@@ -2054,7 +2054,7 @@ pars_create_index(
 		column = static_cast<sym_node_t*>(que_node_get_next(column));
 	}
 
-	node = ind_create_graph_create(index, pars_sym_tab_global->heap);
+	node = ind_create_graph_create(index, pars_sym_tab_global->heap, true);
 
 	table_sym->resolved = TRUE;
 	table_sym->token_type = SYM_TABLE;

=== modified file 'storage/innobase/row/row0merge.cc'
--- a/storage/innobase/row/row0merge.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/row/row0merge.cc	revid:kevin.lewis@stripped
@@ -3111,7 +3111,7 @@ row_merge_create_index_graph(
 	heap = mem_heap_create(512);
 
 	index->table = table;
-	node = ind_create_graph_create(index, heap);
+	node = ind_create_graph_create(index, heap, false);
 	thr = pars_complete_graph_for_exec(node, trx, heap);
 
 	ut_a(thr == que_fork_start_command(

=== modified file 'storage/innobase/row/row0mysql.cc'
--- a/storage/innobase/row/row0mysql.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/row/row0mysql.cc	revid:kevin.lewis@stripped
@@ -2073,7 +2073,8 @@ Creates a table for MySQL. If the name o
 one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
 "innodb_table_monitor", then this will also start the printing of monitor
 output by the master thread. If the table name ends in "innodb_mem_validate",
-InnoDB will try to invoke mem_validate().
+InnoDB will try to invoke mem_validate(). On failure the transaction will
+be rolled back.
 @return	error code or DB_SUCCESS */
 UNIV_INTERN
 dberr_t
@@ -2082,7 +2083,8 @@ row_create_table_for_mysql(
 	dict_table_t*	table,	/*!< in, own: table definition
 				(will be freed, or on DB_SUCCESS
 				added to the data dictionary cache) */
-	trx_t*		trx)	/*!< in/out: transaction */
+	trx_t*		trx,	/*!< in/out: transaction */
+	bool		commit)	/*!< in: if true, commit the transaction */
 {
 	tab_node_t*	node;
 	mem_heap_t*	heap;
@@ -2105,7 +2107,10 @@ row_create_table_for_mysql(
 		      " is replaced with raw.\n", stderr);
 err_exit:
 		dict_mem_table_free(table);
-		trx_commit_for_mysql(trx);
+
+		if (commit) {
+			trx_commit_for_mysql(trx);
+		}
 
 		return(DB_ERROR);
 	}
@@ -2192,7 +2197,7 @@ err_exit:
 		ut_ad(strstr(table->name, "/FTS_") != NULL);
 	}
 
-	node = tab_create_graph_create(table, heap);
+	node = tab_create_graph_create(table, heap, commit);
 
 	thr = pars_complete_graph_for_exec(node, trx, heap);
 
@@ -2215,7 +2220,7 @@ err_exit:
 			err = dict_create_add_tablespace_to_dictionary(
 				table->space, table->name,
 				fil_space_get_flags(table->space),
-				path, trx);
+				path, trx, commit);
 
 			mem_free(path);
 		}
@@ -2251,7 +2256,10 @@ err_exit:
 			dict_table_close(table, FALSE, FALSE);
 
 			row_drop_table_for_mysql(table->name, trx, FALSE);
-			trx_commit_for_mysql(trx);
+
+			if (commit) {
+				trx_commit_for_mysql(trx);
+			}
 		}
 		break;
 
@@ -2364,7 +2372,7 @@ row_create_index_for_mysql(
 	/* Note that the space id where we store the index is inherited from
 	the table in dict_build_index_def_step() in dict0crea.cc. */
 
-	node = ind_create_graph_create(index, heap);
+	node = ind_create_graph_create(index, heap, true);
 
 	thr = pars_complete_graph_for_exec(node, trx, heap);
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (kevin.lewis:3906 to 3907) kevin.lewis29 May