mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
introduce hton->drop_table() method
first step in moving drop table out of the handler. todo: other methods that don't need an open table for now hton->drop_table is optional, for backward compatibility reasons
This commit is contained in:
@ -694,23 +694,19 @@ bool THD::rm_temporary_table(handlerton *base, const char *path)
|
||||
DBUG_ENTER("THD::rm_temporary_table");
|
||||
|
||||
bool error= false;
|
||||
handler *file;
|
||||
char frm_path[FN_REFLEN + 1];
|
||||
|
||||
strxnmov(frm_path, sizeof(frm_path) - 1, path, reg_ext, NullS);
|
||||
if (mysql_file_delete(key_file_frm, frm_path,
|
||||
MYF(MY_WME | MY_IGNORE_ENOENT)))
|
||||
error= true;
|
||||
|
||||
file= get_new_handler((TABLE_SHARE*) 0, current_thd->mem_root, base);
|
||||
if (file && file->ha_delete_table(path))
|
||||
if (base->drop_table(base, path))
|
||||
{
|
||||
error= true;
|
||||
sql_print_warning("Could not remove temporary table: '%s', error: %d",
|
||||
path, my_errno);
|
||||
}
|
||||
|
||||
delete file;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user