mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +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. 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.
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user