List:Commits« Previous MessageNext Message »
From:kevin.lewis Date:February 16 2012 4:35pm
Subject:bzr push into mysql-trunk branch (kevin.lewis:3911 to 3912)
View as plain text  
 3912 kevin.lewis@stripped	2012-02-16
      Refactor fil_space_t::name so that instead of holding a path, it holds
      a table name in the form database/tablename.  This is required in order
      for fil_space_t and fil_node_t to be able to track independently assigned
      tablespace names.
      
      This patch also contains some whitespace and comment cleanup.
      
      Approved by Inaam in rb:906

    modified:
      storage/innobase/dict/dict0boot.cc
      storage/innobase/dict/dict0load.cc
      storage/innobase/fil/fil0fil.cc
      storage/innobase/handler/i_s.cc
      storage/innobase/include/dict0boot.h
      storage/innobase/include/fil0fil.h
      storage/innobase/row/row0merge.cc
      storage/innobase/row/row0mysql.cc
      storage/innobase/row/row0sel.cc
 3911 kevin.lewis@stripped	2012-02-16
      Refactor the use of srv_file_per_table.  It is a global variable that
      can change at any time during a CREATE table process, but it is refered
      to several time during that process.  Save the value of that setting at
      the start of the CREATE and use the same boolean value during the whole
      CREATE.  This patch saves it in dict_table_t:flags2 which is not tested
      for backward compatibility in older engines.  It means that the table
      is/was created in its own tablespace or ibd file.
      
      Approved by Sunny in rb:908

    modified:
      storage/innobase/dict/dict0crea.cc
      storage/innobase/fil/fil0fil.cc
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/dict0mem.h
      storage/innobase/include/fil0fil.h
      storage/innobase/row/row0mysql.cc
=== modified file 'storage/innobase/dict/dict0boot.cc'
--- a/storage/innobase/dict/dict0boot.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/dict/dict0boot.cc	revid:kevin.lewis@stripped
@@ -257,20 +257,20 @@ dict_boot(void)
 	/* Be sure these constants do not ever change.  To avoid bloat,
 	only check the *NUM_FIELDS* in each table */
 
-	ut_ad(DICT_NUM_COLS__SYS_TABLES == 8);
-	ut_ad(DICT_NUM_FIELDS__SYS_TABLES == 10);
-	ut_ad(DICT_NUM_FIELDS__SYS_TABLE_IDS == 2);
-	ut_ad(DICT_NUM_COLS__SYS_COLUMNS == 7);
-	ut_ad(DICT_NUM_FIELDS__SYS_COLUMNS == 9);
-	ut_ad(DICT_NUM_COLS__SYS_INDEXES == 7);
-	ut_ad(DICT_NUM_FIELDS__SYS_INDEXES == 9);
-	ut_ad(DICT_NUM_COLS__SYS_FIELDS == 3);
-	ut_ad(DICT_NUM_FIELDS__SYS_FIELDS == 5);
-	ut_ad(DICT_NUM_COLS__SYS_FOREIGN == 4);
-	ut_ad(DICT_NUM_FIELDS__SYS_FOREIGN == 6);
-	ut_ad(DICT_NUM_FIELDS__SYS_FOREIGN_FOR_NAME == 2);
-	ut_ad(DICT_NUM_COLS__SYS_FOREIGN_COLS == 4);
-	ut_ad(DICT_NUM_FIELDS__SYS_FOREIGN_COLS == 6);
+	ut_ad(DICT_NUM_COLS__SYS_TABLES == 8);
+	ut_ad(DICT_NUM_FIELDS__SYS_TABLES == 10);
+	ut_ad(DICT_NUM_FIELDS__SYS_TABLE_IDS == 2);
+	ut_ad(DICT_NUM_COLS__SYS_COLUMNS == 7);
+	ut_ad(DICT_NUM_FIELDS__SYS_COLUMNS == 9);
+	ut_ad(DICT_NUM_COLS__SYS_INDEXES == 7);
+	ut_ad(DICT_NUM_FIELDS__SYS_INDEXES == 9);
+	ut_ad(DICT_NUM_COLS__SYS_FIELDS == 3);
+	ut_ad(DICT_NUM_FIELDS__SYS_FIELDS == 5);
+	ut_ad(DICT_NUM_COLS__SYS_FOREIGN == 4);
+	ut_ad(DICT_NUM_FIELDS__SYS_FOREIGN == 6);
+	ut_ad(DICT_NUM_FIELDS__SYS_FOREIGN_FOR_NAME == 2);
+	ut_ad(DICT_NUM_COLS__SYS_FOREIGN_COLS == 4);
+	ut_ad(DICT_NUM_FIELDS__SYS_FOREIGN_COLS == 6);
 
 	mtr_start(&mtr);
 
@@ -447,6 +447,7 @@ dict_boot(void)
 	ut_a(error == DB_SUCCESS);
 
 	mtr_commit(&mtr);
+
 	/*-------------------------*/
 
 	/* Initialize the insert buffer table and index for each tablespace */

=== 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
@@ -258,7 +258,7 @@ dict_getnext_system_low(
 }
 
 /********************************************************************//**
-This function opens a system table, and return the first record.
+This function opens a system table, and returns the first record.
 @return	first record of the system table */
 UNIV_INTERN
 const rec_t*
@@ -779,7 +779,7 @@ loop:
 			}
 
 			fil_space_for_table_exists_in_mem(
-				space_id, name, is_temp, TRUE, !is_temp);
+				space_id, name, TRUE, !is_temp);
 		} else {
 			/* It is a normal database startup: create the space
 			object and check that the .ibd file exists. */
@@ -1847,9 +1847,7 @@ err_exit:
 	if (table->space == 0) {
 		/* The system tablespace is always available. */
 	} else if (!fil_space_for_table_exists_in_mem(
-			   table->space, name,
-			   table->flags2 & DICT_TF2_TEMPORARY,
-			   FALSE, FALSE)) {
+			table->space, name, FALSE, FALSE)) {
 
 		if (table->flags2 & DICT_TF2_TEMPORARY) {
 			/* Do not bother to retry opening temporary tables. */

=== 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
@@ -2338,7 +2338,10 @@ try_again:
 
 	space->is_being_deleted = TRUE;
 
+	/* TODO: The following code must change when InnoDB supports
+	multiple datafiles per tablespace. */
 	ut_a(UT_LIST_GET_LEN(space->chain) == 1);
+
 	node = UT_LIST_GET_FIRST(space->chain);
 
 	if (space->n_pending_flushes > 0 || node->n_pending > 0
@@ -2365,7 +2368,7 @@ try_again:
 		goto try_again;
 	}
 
-	path = mem_strdup(space->name);
+	path = mem_strdup(node->name);
 
 	mutex_exit(&fil_system->mutex);
 
@@ -2505,7 +2508,8 @@ fil_rename_tablespace_in_mem(
 /*=========================*/
 	fil_space_t*	space,	/*!< in: tablespace memory object */
 	fil_node_t*	node,	/*!< in: file node of that tablespace */
-	const char*	path)	/*!< in: new name */
+	const char*	new_name,	/*!< in: new name */
+	const char*	new_path)	/*!< in: new file path */
 {
 	fil_space_t*	space2;
 	const char*	old_name	= space->name;
@@ -2521,10 +2525,10 @@ fil_rename_tablespace_in_mem(
 		return(FALSE);
 	}
 
-	space2 = fil_space_get_by_name(path);
+	space2 = fil_space_get_by_name(new_name);
 	if (space2 != NULL) {
 		fputs("InnoDB: Error: ", stderr);
-		ut_print_filename(stderr, path);
+		ut_print_filename(stderr, new_name);
 		fputs(" is already in tablespace memory cache\n", stderr);
 
 		return(FALSE);
@@ -2535,11 +2539,11 @@ fil_rename_tablespace_in_mem(
 	mem_free(space->name);
 	mem_free(node->name);
 
-	space->name = mem_strdup(path);
-	node->name = mem_strdup(path);
+	space->name = mem_strdup(new_name);
+	node->name = mem_strdup(new_path);
 
 	HASH_INSERT(fil_space_t, name_hash, fil_system->name_hash,
-		    ut_fold_string(path), space);
+		    ut_fold_string(new_name), space);
 	return(TRUE);
 }
 
@@ -2586,7 +2590,7 @@ UNIV_INTERN
 ibool
 fil_rename_tablespace(
 /*==================*/
-	const char*	old_name,	/*!< in: old table name in the standard
+	const char*	old_name_in,	/*!< in: old table name in the standard
 					databasename/tablename format of
 					InnoDB, or NULL if we do the rename
 					based on the space id only */
@@ -2599,23 +2603,21 @@ fil_rename_tablespace(
 	fil_space_t*	space;
 	fil_node_t*	node;
 	ulint		count		= 0;
-	char*		path;
-	ibool		old_name_was_specified		= TRUE;
+	char*		new_path;
+	char*		old_name;
 	char*		old_path;
+	const char*	not_given	= "(name not specified)";
 
 	ut_a(id != 0);
 
-	if (old_name == NULL) {
-		old_name = "(name not specified)";
-		old_name_was_specified = FALSE;
-	}
 retry:
 	count++;
 
 	if (!(count % 1000)) {
 		ut_print_timestamp(stderr);
 		fputs("  InnoDB: Warning: problems renaming ", stderr);
-		ut_print_filename(stderr, old_name);
+		ut_print_filename(stderr,
+				  old_name_in ? old_name_in : not_given);
 		fputs(" to ", stderr);
 		ut_print_filename(stderr, new_name);
 		fprintf(stderr, ", %lu iterations\n", (ulong) count);
@@ -2630,7 +2632,8 @@ retry:
 			"InnoDB: Error: cannot find space id %lu"
 			" in the tablespace memory cache\n"
 			"InnoDB: though the table ", (ulong) id);
-		ut_print_filename(stderr, old_name);
+		ut_print_filename(stderr,
+				  old_name_in ? old_name_in : not_given);
 		fputs(" in a rename operation should have that id\n", stderr);
 		mutex_exit(&fil_system->mutex);
 
@@ -2684,34 +2687,35 @@ retry:
 
 	/* Check that the old name in the space is right */
 
-	if (old_name_was_specified) {
+	if (old_name_in) {
+		old_name = mem_strdup(old_name_in);
 		old_path = fil_make_ibd_name(old_name, FALSE);
 
-		ut_a(strcmp(space->name, old_path) == 0);
+		ut_a(strcmp(space->name, old_name) == 0);
 		ut_a(strcmp(node->name, old_path) == 0);
 	} else {
-		old_path = mem_strdup(space->name);
+		old_name = mem_strdup(space->name);
+		old_path = mem_strdup(node->name);
 	}
 
 	/* Rename the tablespace and the node in the memory cache */
-	path = fil_make_ibd_name(new_name, FALSE);
-	success = fil_rename_tablespace_in_mem(space, node, path);
+	new_path = fil_make_ibd_name(new_name, FALSE);
+	success = fil_rename_tablespace_in_mem(
+		space, node, new_name, new_path);
 
 	if (success) {
-		success = os_file_rename(innodb_file_data_key, old_path, path);
+		success = os_file_rename(
+			innodb_file_data_key, old_path, new_path);
 
 		if (!success) {
 			/* We have to revert the changes we made
 			to the tablespace memory cache */
 
-			ut_a(fil_rename_tablespace_in_mem(space, node,
-							  old_path));
+			ut_a(fil_rename_tablespace_in_mem(
+					space, node, old_name, old_path));
 		}
 	}
 
-	mem_free(path);
-	mem_free(old_path);
-
 	space->stop_ios = FALSE;
 
 	mutex_exit(&fil_system->mutex);
@@ -2727,6 +2731,11 @@ retry:
 		mtr_commit(&mtr);
 	}
 #endif
+
+	mem_free(new_path);
+	mem_free(old_path);
+	mem_free(old_name);
+
 	return(success);
 }
 
@@ -2897,7 +2906,7 @@ error_exit2:
 
 	os_file_close(file);
 
-	success = fil_space_create(path, space_id, flags, FIL_TABLESPACE);
+	success = fil_space_create(tablename, space_id, flags, FIL_TABLESPACE);
 
 	if (!success) {
 		err = DB_ERROR;
@@ -3121,7 +3130,7 @@ fil_open_single_table_tablespace(
 					accessing the first page of the file */
 	ulint		id,		/*!< in: space id */
 	ulint		flags,		/*!< in: tablespace flags */
-	const char*	name)		/*!< in: table name in the
+	const char*	tablename)	/*!< in: table name in the
 					databasename/tablename format */
 {
 	os_file_t	file;
@@ -3132,7 +3141,7 @@ fil_open_single_table_tablespace(
 	ulint		space_id;
 	ulint		space_flags;
 
-	filepath = fil_make_ibd_name(name, FALSE);
+	filepath = fil_make_ibd_name(tablename, FALSE);
 
 	fsp_flags_validate(flags);
 
@@ -3158,7 +3167,8 @@ fil_open_single_table_tablespace(
 		      " a temporary table #sql...,\n"
 		      "InnoDB: and MySQL removed the .ibd file for this.\n"
 		      "InnoDB: Please refer to\n"
-		      "InnoDB: " REFMAN "innodb-troubleshooting-datadict.html\n"
+		      "InnoDB: " REFMAN
+		      "innodb-troubleshooting-datadict.html\n"
 		      "InnoDB: for how to resolve the issue.\n", stderr);
 
 		mem_free(filepath);
@@ -3211,7 +3221,7 @@ fil_open_single_table_tablespace(
 	}
 
 skip_check:
-	success = fil_space_create(filepath, space_id, flags, FIL_TABLESPACE);
+	success = fil_space_create(tablename, space_id, flags, FIL_TABLESPACE);
 
 	if (!success) {
 		goto func_exit;
@@ -3266,6 +3276,7 @@ fil_load_single_table_tablespace(
 {
 	os_file_t	file;
 	char*		filepath;
+	char*		tablename;
 	ibool		success;
 	byte*		buf2;
 	byte*		page;
@@ -3284,6 +3295,12 @@ fil_load_single_table_tablespace(
 	sprintf(filepath, "%s/%s/%s", fil_path_to_mysql_datadir, dbname,
 		filename);
 	srv_normalize_path_for_win(filepath);
+
+	tablename = static_cast<char*>(
+		mem_alloc(strlen(dbname) + strlen(filename) + 2));
+	sprintf(tablename, "%s/%s", dbname, filename);
+	tablename[strlen(tablename) - strlen(".ibd")] = 0;
+
 #ifdef __WIN__
 # ifndef UNIV_HOTBACKUP
 	/* If lower_case_table_names is 0 or 2, then MySQL allows database
@@ -3327,6 +3344,7 @@ fil_load_single_table_tablespace(
 			"InnoDB: and force InnoDB to continue crash"
 			" recovery here.\n", filepath);
 
+		mem_free(tablename);
 		mem_free(filepath);
 
 		if (srv_force_recovery > 0) {
@@ -3374,6 +3392,7 @@ fil_load_single_table_tablespace(
 			" crash recovery here.\n", filepath);
 
 		os_file_close(file);
+		mem_free(tablename);
 		mem_free(filepath);
 
 		if (srv_force_recovery > 0) {
@@ -3398,12 +3417,14 @@ fil_load_single_table_tablespace(
 #ifndef UNIV_HOTBACKUP
 	if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
 		fprintf(stderr,
-			"InnoDB: Error: the size of single-table tablespace"
-			" file %s\n"
-			"InnoDB: is only "UINT64PF", should be at least %lu!",
+			"InnoDB: Error: the size of single-table"
+			" tablespace file %s\n"
+			"InnoDB: is only " UINT64PF
+			", should be at least %lu!\n",
 			filepath,
 			size, (ulong) (4 * UNIV_PAGE_SIZE));
 		os_file_close(file);
+		mem_free(tablename);
 		mem_free(filepath);
 
 		return;
@@ -3456,6 +3477,7 @@ fil_load_single_table_tablespace(
 		ut_a(os_file_rename(innodb_file_data_key, filepath, new_path));
 
 		ut_free(buf2);
+		mem_free(tablename);
 		mem_free(filepath);
 		mem_free(new_path);
 
@@ -3494,6 +3516,7 @@ fil_load_single_table_tablespace(
 		ut_a(os_file_rename(innodb_file_data_key, filepath, new_path));
 
 		ut_free(buf2);
+		mem_free(tablename);
 		mem_free(filepath);
 		mem_free(new_path);
 
@@ -3501,7 +3524,7 @@ fil_load_single_table_tablespace(
 	}
 	mutex_exit(&fil_system->mutex);
 #endif
-	success = fil_space_create(filepath, space_id, flags, FIL_TABLESPACE);
+	success = fil_space_create(tablename, space_id, flags, FIL_TABLESPACE);
 
 	if (!success) {
 
@@ -3526,6 +3549,7 @@ fil_load_single_table_tablespace(
 func_exit:
 	os_file_close(file);
 	ut_free(buf2);
+	mem_free(tablename);
 	mem_free(filepath);
 }
 
@@ -3770,10 +3794,7 @@ fil_space_for_table_exists_in_mem(
 /*==============================*/
 	ulint		id,		/*!< in: space id */
 	const char*	name,		/*!< in: table name in the standard
-					'databasename/tablename' format or
-					the dir path to a temp table */
-	ibool		is_temp,	/*!< in: TRUE if created with CREATE
-					TEMPORARY TABLE */
+					'databasename/tablename' format */
 	ibool		mark_space,	/*!< in: in crash recovery, at database
 					startup we mark all spaces which have
 					an associated table in the InnoDB
@@ -3788,14 +3809,11 @@ fil_space_for_table_exists_in_mem(
 {
 	fil_space_t*	fnamespace;
 	fil_space_t*	space;
-	char*		path;
 
 	ut_ad(fil_system);
 
 	mutex_enter(&fil_system->mutex);
 
-	path = fil_make_ibd_name(name, is_temp);
-
 	/* Look if there is a space with the same id */
 
 	space = fil_space_get_by_id(id);
@@ -3803,7 +3821,7 @@ fil_space_for_table_exists_in_mem(
 	/* Look if there is a space with the same name; the name is the
 	directory path from the datadir to the file */
 
-	fnamespace = fil_space_get_by_name(path);
+	fnamespace = fil_space_get_by_name(name);
 	if (space && space == fnamespace) {
 		/* Found */
 
@@ -3811,7 +3829,6 @@ fil_space_for_table_exists_in_mem(
 			space->mark = TRUE;
 		}
 
-		mem_free(path);
 		mutex_exit(&fil_system->mutex);
 
 		return(TRUE);
@@ -3819,7 +3836,6 @@ fil_space_for_table_exists_in_mem(
 
 	if (!print_error_if_does_not_exist) {
 
-		mem_free(path);
 		mutex_exit(&fil_system->mutex);
 
 		return(FALSE);
@@ -3863,13 +3879,12 @@ error_exit:
 		      "InnoDB: " REFMAN "innodb-troubleshooting-datadict.html\n"
 		      "InnoDB: for how to resolve the issue.\n", stderr);
 
-		mem_free(path);
 		mutex_exit(&fil_system->mutex);
 
 		return(FALSE);
 	}
 
-	if (0 != strcmp(space->name, path)) {
+	if (0 != strcmp(space->name, name)) {
 		ut_print_timestamp(stderr);
 		fputs("  InnoDB: Error: table ", stderr);
 		ut_print_filename(stderr, name);
@@ -3893,7 +3908,6 @@ error_exit:
 		goto error_exit;
 	}
 
-	mem_free(path);
 	mutex_exit(&fil_system->mutex);
 
 	return(FALSE);
@@ -3907,30 +3921,24 @@ static
 ulint
 fil_get_space_id_for_table(
 /*=======================*/
-	const char*	name)	/*!< in: table name in the standard
+	const char*	tablename)	/*!< in: table name in the standard
 				'databasename/tablename' format */
 {
 	fil_space_t*	fnamespace;
 	ulint		id		= ULINT_UNDEFINED;
-	char*		path;
 
 	ut_ad(fil_system);
 
 	mutex_enter(&fil_system->mutex);
 
-	path = fil_make_ibd_name(name, FALSE);
+	/* Look if there is a space with the same name. */
 
-	/* Look if there is a space with the same name; the name is the
-	directory path to the file */
-
-	fnamespace = fil_space_get_by_name(path);
+	fnamespace = fil_space_get_by_name(tablename);
 
 	if (fnamespace) {
 		id = fnamespace->id;
 	}
 
-	mem_free(path);
-
 	mutex_exit(&fil_system->mutex);
 
 	return(id);

=== modified file 'storage/innobase/handler/i_s.cc'
--- a/storage/innobase/handler/i_s.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/handler/i_s.cc	revid:kevin.lewis@stripped
@@ -4494,12 +4494,12 @@ i_s_innodb_buffer_page_fill(
 			page_info->fix_count));
 
 		if (page_info->hashed) {
-                        OK(field_store_string(
-                                fields[IDX_BUFFER_PAGE_HASHED], "YES"));
-                } else {
-                        OK(field_store_string(
-                                fields[IDX_BUFFER_PAGE_HASHED], "NO"));
-                }
+			OK(field_store_string(
+				fields[IDX_BUFFER_PAGE_HASHED], "YES"));
+		} else {
+			OK(field_store_string(
+				fields[IDX_BUFFER_PAGE_HASHED], "NO"));
+		}
 
 		OK(fields[IDX_BUFFER_PAGE_NEWEST_MOD]->store(
 			(longlong) page_info->newest_mod, true));

=== modified file 'storage/innobase/include/dict0boot.h'
--- a/storage/innobase/include/dict0boot.h	revid:kevin.lewis@stripped
+++ b/storage/innobase/include/dict0boot.h	revid:kevin.lewis@stripped
@@ -178,7 +178,7 @@ enum dict_col_sys_columns_enum {
 	DICT_COL__SYS_COLUMNS__PREC		= 6,
 	DICT_NUM_COLS__SYS_COLUMNS		= 7
 };
-/* The field numbers in the SYS_TABLES clustered index */
+/* The field numbers in the SYS_COLUMNS clustered index */
 enum dict_fld_sys_columns_enum {
 	DICT_FLD__SYS_COLUMNS__TABLE_ID		= 0,
 	DICT_FLD__SYS_COLUMNS__POS		= 1,
@@ -222,7 +222,7 @@ enum dict_col_sys_fields_enum {
 	DICT_COL__SYS_FIELDS__COL_NAME		= 2,
 	DICT_NUM_COLS__SYS_FIELDS		= 3
 };
-/* The field numbers in the SYS_INDEXES clustered index */
+/* The field numbers in the SYS_FIELDS clustered index */
 enum dict_fld_sys_fields_enum {
 	DICT_FLD__SYS_FIELDS__INDEX_ID		= 0,
 	DICT_FLD__SYS_FIELDS__POS		= 1,

=== modified file 'storage/innobase/include/fil0fil.h'
--- a/storage/innobase/include/fil0fil.h	revid:kevin.lewis@stripped
+++ b/storage/innobase/include/fil0fil.h	revid:kevin.lewis@stripped
@@ -434,7 +434,7 @@ UNIV_INTERN
 ibool
 fil_rename_tablespace(
 /*==================*/
-	const char*	old_name,	/*!< in: old table name in the standard
+	const char*	old_name_in,	/*!< in: old table name in the standard
 					databasename/tablename format of
 					InnoDB, or NULL if we do the rename
 					based on the space id only */
@@ -556,10 +556,7 @@ fil_space_for_table_exists_in_mem(
 /*==============================*/
 	ulint		id,		/*!< in: space id */
 	const char*	name,		/*!< in: table name in the standard
-					'databasename/tablename' format or
-					the dir path to a temp table */
-	ibool		is_temp,	/*!< in: TRUE if created with CREATE
-					TEMPORARY TABLE */
+					'databasename/tablename' format */
 	ibool		mark_space,	/*!< in: in crash recovery, at database
 					startup we mark all spaces which have
 					an associated table in the InnoDB

=== 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
@@ -2563,7 +2563,7 @@ row_merge_create_temporary_table(
 				       col->len);
 	}
 
-        /* Add the FTS doc_id hidden column */
+	/* Add the FTS doc_id hidden column */
 	if (DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_ADD_DOC_ID)) {
 		fts_add_doc_id_column(new_table);
 		new_table->fts->doc_col = n_cols;

=== 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
@@ -3753,7 +3753,6 @@ check_next_foreign:
 
 	switch (err) {
 		ibool		is_temp;
-		const char*	name_or_path;
 		mem_heap_t*	heap;
 
 	case DB_SUCCESS:
@@ -3766,14 +3765,8 @@ check_next_foreign:
 		name = mem_heap_strdup(heap, name);
 		space_id = table->space;
 
-		if (table->dir_path_of_temp_table != NULL) {
-			name_or_path = mem_heap_strdup(
-				heap, table->dir_path_of_temp_table);
-			is_temp = TRUE;
-		} else {
-			name_or_path = name;
-			is_temp = table->flags2 & DICT_TF2_TEMPORARY;
-		}
+		is_temp = table->flags2 & DICT_TF2_TEMPORARY;
+		ut_a(table->dir_path_of_temp_table == NULL || is_temp);
 
 		if (dict_table_has_fts_index(table)
 		    || DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID)) {
@@ -3809,10 +3802,8 @@ check_next_foreign:
 		wrong: we do not want to delete valuable data of the user */
 
 		if (err == DB_SUCCESS && space_id > 0) {
-			if (!fil_space_for_table_exists_in_mem(space_id,
-							       name_or_path,
-							       is_temp, FALSE,
-							       !is_temp)) {
+			if (!fil_space_for_table_exists_in_mem(
+					space_id, name, FALSE, !is_temp)) {
 				err = DB_SUCCESS;
 
 				fprintf(stderr,

=== modified file 'storage/innobase/row/row0sel.cc'
--- a/storage/innobase/row/row0sel.cc	revid:kevin.lewis@stripped
+++ b/storage/innobase/row/row0sel.cc	revid:kevin.lewis@stripped
@@ -2080,7 +2080,7 @@ row_sel_step(
 			for (table_node = node->table_list;
 			     table_node != 0;
 			     table_node = static_cast<sym_node_t*>(
-				     	que_node_get_next(table_node))) {
+					que_node_get_next(table_node))) {
 
 				enum db_err	err;
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (kevin.lewis:3911 to 3912) kevin.lewis16 Feb