summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2004-10-07 20:53:20 +0300
committerunknown <heikki@hundin.mysql.fi>2004-10-07 20:53:20 +0300
commit7efa215e254dc21ec89a30578669d31064d15f9c (patch)
tree6f703fce19246e6df6d180aa783050b5119d5b15 /sql
parent5a390c9c70c8f28ea481870bf8ee6c5daabe00bc (diff)
downloadmariadb-git-7efa215e254dc21ec89a30578669d31064d15f9c.tar.gz
Many files:
Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) sql/ha_innodb.cc: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) innobase/row/row0mysql.c: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) innobase/fil/fil0fil.c: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) innobase/dict/dict0crea.c: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) innobase/dict/dict0dict.c: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) innobase/dict/dict0load.c: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) innobase/dict/dict0mem.c: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) innobase/include/mem0mem.ic: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) innobase/include/dict0mem.h: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) innobase/include/fil0fil.h: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) innobase/include/mem0mem.h: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1) innobase/mem/mem0mem.c: Fix bug #5137: if innodb_file_per_table was specified, CREATE TEMPORARY TABLE ... TYPE=InnoDB said that cannot find path specified, and made mysqld to exit(1)
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innodb.cc31
1 files changed, 24 insertions, 7 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index cb35c63357e..f10731628da 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -3353,7 +3353,15 @@ create_table_def(
trx_t* trx, /* in: InnoDB transaction handle */
TABLE* form, /* in: information on table
columns and indexes */
- const char* table_name) /* in: table name */
+ const char* table_name, /* in: table name */
+ const char* path_of_temp_table)/* in: if this is a table explicitly
+ created by the user with the
+ TEMPORARY keyword, then this
+ parameter is the dir path where the
+ table should be placed if we create
+ an .ibd file for it (no .ibd extension
+ in the path, though); otherwise this
+ is NULL */
{
Field* field;
dict_table_t* table;
@@ -3376,6 +3384,11 @@ create_table_def(
table = dict_mem_table_create((char*) table_name, 0, n_cols);
+ if (path_of_temp_table) {
+ table->dir_path_of_temp_table =
+ mem_heap_strdup(table->heap, path_of_temp_table);
+ }
+
for (i = 0; i < n_cols; i++) {
field = form->field[i];
@@ -3456,8 +3469,7 @@ create_index(
ind_type = 0;
- if (key_num == form->primary_key)
- {
+ if (key_num == form->primary_key) {
ind_type = ind_type | DICT_CLUSTERED;
}
@@ -3622,7 +3634,7 @@ ha_innobase::create(
srv_lower_case_table_names = FALSE;
}
- fn_format(name2, name, "", "",2); // Remove the .frm extension
+ fn_format(name2, name, "", "", 2); // Remove the .frm extension
normalize_table_name(norm_name, name2);
@@ -3634,8 +3646,13 @@ ha_innobase::create(
/* Create the table definition in InnoDB */
- error = create_table_def(trx, form, norm_name);
-
+ if (create_info->options & HA_LEX_CREATE_TMP_TABLE) {
+
+ error = create_table_def(trx, form, norm_name, name2);
+ } else {
+ error = create_table_def(trx, form, norm_name, NULL);
+ }
+
if (error) {
innobase_commit_low(trx);
@@ -3710,8 +3727,8 @@ ha_innobase::create(
}
if (current_thd->query != NULL) {
-
LEX_STRING q;
+
if (thd->convert_string(&q, system_charset_info,
current_thd->query,
current_thd->query_length,