diff options
Diffstat (limited to 'innobase/dict')
-rw-r--r-- | innobase/dict/dict0crea.c | 15 | ||||
-rw-r--r-- | innobase/dict/dict0dict.c | 12 | ||||
-rw-r--r-- | innobase/dict/dict0load.c | 4 | ||||
-rw-r--r-- | innobase/dict/dict0mem.c | 1 |
4 files changed, 27 insertions, 5 deletions
diff --git a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c index c887d821a3f..137964b26c1 100644 --- a/innobase/dict/dict0crea.c +++ b/innobase/dict/dict0crea.c @@ -205,6 +205,8 @@ dict_build_table_def_step( dict_table_t* cluster_table; dtuple_t* row; ulint error; + const char* path_or_name; + ibool is_path; mtr_t mtr; #ifdef UNIV_SYNC_DEBUG @@ -245,8 +247,19 @@ dict_build_table_def_step( table->space = 0; /* reset to zero for the call below */ + if (table->dir_path_of_temp_table) { + /* We place tables created with CREATE TEMPORARY + TABLE in the tmp dir of mysqld server */ + + path_or_name = table->dir_path_of_temp_table; + is_path = TRUE; + } else { + path_or_name = table->name; + is_path = FALSE; + } + error = fil_create_new_single_table_tablespace( - &(table->space), table->name, + &(table->space), path_or_name, is_path, FIL_IBD_FILE_INITIAL_SIZE); if (error != DB_SUCCESS) { diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index aa7e90700f8..fd98538d2ad 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -943,8 +943,16 @@ dict_table_rename_in_cache( .ibd file */ if (table->space != 0) { - success = fil_rename_tablespace(table->name, table->space, - new_name); + if (table->dir_path_of_temp_table != NULL) { + fprintf(stderr, +"InnoDB: Error: trying to rename a table %s (%s) created with CREATE\n" +"InnoDB: TEMPORARY TABLE\n", table->name, table->dir_path_of_temp_table); + success = FALSE; + } else { + success = fil_rename_tablespace(table->name, + table->space, new_name); + } + if (!success) { return(FALSE); diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index 9293b117899..1866921c589 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -262,7 +262,7 @@ loop: exists; print a warning to the .err log if not */ fil_space_for_table_exists_in_mem(space_id, name, - TRUE, TRUE); + FALSE, TRUE, TRUE); } mem_free(name); @@ -761,7 +761,7 @@ dict_load_table( /* Check if the tablespace exists and has the right name */ if (space != 0) { if (fil_space_for_table_exists_in_mem(space, name, FALSE, - FALSE)) { + FALSE, FALSE)) { /* Ok; (if we did a crash recovery then the tablespace can already be in the memory cache) */ } else { diff --git a/innobase/dict/dict0mem.c b/innobase/dict/dict0mem.c index 8f05475df47..1d45585aac1 100644 --- a/innobase/dict/dict0mem.c +++ b/innobase/dict/dict0mem.c @@ -50,6 +50,7 @@ dict_mem_table_create( table->type = DICT_TABLE_ORDINARY; table->name = mem_heap_strdup(heap, name); + table->dir_path_of_temp_table = NULL; table->space = space; table->ibd_file_missing = FALSE; table->tablespace_discarded = FALSE; |