1
0
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:
Sergei Golubchik
2020-06-13 21:23:19 +02:00
parent f17f7a43ba
commit c55c292832
9 changed files with 70 additions and 95 deletions

View File

@ -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);
}