summaryrefslogtreecommitdiff
path: root/sql/sql_rename.cc
diff options
context:
space:
mode:
authorunknown <jani@ua141d10.elisa.omakaista.fi>2005-11-03 16:10:11 +0200
committerunknown <jani@ua141d10.elisa.omakaista.fi>2005-11-03 16:10:11 +0200
commit5af7ca80d98459b9c163328eaf8709abdf8c9883 (patch)
tree533bc3410929cad9d7bedd3ecdd6edd46725efa1 /sql/sql_rename.cc
parentabd77bc56397c1522f2b729334f877f9806dafd2 (diff)
downloadmariadb-git-5af7ca80d98459b9c163328eaf8709abdf8c9883.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. sql/mysql_priv.h: Merged functions get_table_type() and mysql_frm_type() into one, using the name from latter one. sql/sql_base.cc: Changed get_table_type() to mysql_frm_type() sql/sql_delete.cc: Changed get_table_type() to mysql_frm_type() sql/sql_rename.cc: Changed get_table_type() to mysql_frm_type() sql/sql_show.cc: Changed get_table_type() to mysql_frm_type() sql/sql_table.cc: Changed get_table_type() to mysql_frm_type() sql/sql_view.cc: Merged code from get_table_type() and mysql_frm_type() into the latter one. sql/sql_view.h: Function prototype changes. sql/table.cc: No longer needed.
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,