1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
jani@ua141d10.elisa.omakaista.fi
2005-11-03 16:10:11 +02:00
parent c88f0e9c19
commit 0ee589b4d6
9 changed files with 45 additions and 44 deletions

View File

@ -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,