summaryrefslogtreecommitdiff
path: root/sql/sql_rename.cc
diff options
context:
space:
mode:
authorjani@ua141d10.elisa.omakaista.fi <>2005-11-03 16:10:11 +0200
committerjani@ua141d10.elisa.omakaista.fi <>2005-11-03 16:10:11 +0200
commit0ee589b4d612f3b0a087a96620174f4a7b70022b (patch)
tree533bc3410929cad9d7bedd3ecdd6edd46725efa1 /sql/sql_rename.cc
parentc88f0e9c198793c597d0281566fbbc6be2ab63db (diff)
downloadmariadb-git-0ee589b4d612f3b0a087a96620174f4a7b70022b.tar.gz
Changes in get_table_type() and mysql_frm_type(). The main problem was
that in mysql_rm_table_part2_with_lock() previously we needed to open same file twice. Now once is enough.
Diffstat (limited to 'sql/sql_rename.cc')
-rw-r--r--sql/sql_rename.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 154e828b47e..80fcb973028 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -134,6 +134,8 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error)
{
TABLE_LIST *ren_table,*new_table;
frm_type_enum frm_type;
+ db_type table_type;
+
DBUG_ENTER("rename_tables");
for (ren_table= table_list; ren_table; ren_table= new_table->next_local)
@@ -166,13 +168,12 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error)
reg_ext);
unpack_filename(name, name);
- frm_type= mysql_frm_type(name);
+ frm_type= mysql_frm_type(thd, name, &table_type);
switch (frm_type)
{
case FRMTYPE_TABLE:
{
- db_type table_type;
- if ((table_type= get_table_type(thd, name)) == DB_TYPE_UNKNOWN)
+ if (table_type == DB_TYPE_UNKNOWN)
my_error(ER_FILE_NOT_FOUND, MYF(0), name, my_errno);
else
rc= mysql_rename_table(table_type, ren_table->db, old_alias,