1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-11412 Ensure that table is truly dropped when using DROP TABLE

minor post-review fixes
* remove duplicate tests
* first file indicates table existance even with discovery
* don't duplicate trigger dropping code
This commit is contained in:
Sergei Golubchik
2020-06-15 12:13:44 +02:00
parent b014720b6c
commit 2bb5981c20
4 changed files with 13 additions and 75 deletions

View File

@ -4457,21 +4457,12 @@ int handler::delete_table(const char *name)
// For discovery tables, it's ok if first file doesn't exists
if (ht->discover_table)
{
abort_if_first_file_error= 0;
saved_error= 0;
if (!bas_ext())
{
DBUG_ASSERT(ht->flags & HTON_AUTOMATIC_DELETE_TABLE);
DBUG_RETURN(0); // Drop succeded
}
}
for (const char **ext= bas_ext(); *ext ; ext++)
{
int error;
if ((error= mysql_file_delete_with_symlink(key_file_misc, name, *ext,
MYF(0))))
int err= mysql_file_delete_with_symlink(key_file_misc, name, *ext, MYF(0));
if (err)
{
if (my_errno != ENOENT)
{