diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2019-01-29 23:36:44 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2019-04-03 16:47:26 +0400 |
commit | 878f83151f58b8fbf1b6102f32c5bfabbca3c478 (patch) | |
tree | a5dfe87c0ae54c1e895a7c028c88e6b4b2414ab2 /sql/datadict.cc | |
parent | 1dac55cf0ef4a412d56ea870835e1e199a400820 (diff) | |
download | mariadb-git-878f83151f58b8fbf1b6102f32c5bfabbca3c478.tar.gz |
Simplified dd_recreate_table()
It is used only with persistent tables, so remove path argument, which
was introduced in 9594107f and became useless after ce6a63e.
Part of MDEV-17805 - Remove InnoDB cache for temporary tables.
Diffstat (limited to 'sql/datadict.cc')
-rw-r--r-- | sql/datadict.cc | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/sql/datadict.cc b/sql/datadict.cc index 231e7ea22ca..dae2de9b393 100644 --- a/sql/datadict.cc +++ b/sql/datadict.cc @@ -181,39 +181,24 @@ err: @param thd Thread context. @param db Name of the database to which the table belongs to. @param name Table name. - @param path For temporary tables only - path to table files. - Otherwise NULL (the path is calculated from db and table names). @retval FALSE Success. @retval TRUE Error. */ -bool dd_recreate_table(THD *thd, const char *db, const char *table_name, - const char *path) +bool dd_recreate_table(THD *thd, const char *db, const char *table_name) { - bool error= TRUE; HA_CREATE_INFO create_info; char path_buf[FN_REFLEN + 1]; DBUG_ENTER("dd_recreate_table"); + /* There should be a exclusive metadata lock on the table. */ + DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, + MDL_EXCLUSIVE)); create_info.init(); - - if (path) - create_info.options|= HA_LEX_CREATE_TMP_TABLE; - else - { - build_table_filename(path_buf, sizeof(path_buf) - 1, - db, table_name, "", 0); - path= path_buf; - - /* There should be a exclusive metadata lock on the table. */ - DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, - MDL_EXCLUSIVE)); - } - + build_table_filename(path_buf, sizeof(path_buf) - 1, + db, table_name, "", 0); /* Attempt to reconstruct the table. */ - error= ha_create_table(thd, path, db, table_name, &create_info, NULL); - - DBUG_RETURN(error); + DBUG_RETURN(ha_create_table(thd, path_buf, db, table_name, &create_info, 0)); } |