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

MDEV-27753 Incorrect ENGINE type of table after crash for CONNECT table

whenever possible, partitioning should use the full
partition plugin name, not the one byte legacy code.

Normally, ha_partition can get the engine plugin from
table_share->default_part_plugin.

But in some cases, e.g. in DROP TABLE, the table isn't
opened, table_share is NULL, and ha_partition has to parse
the frm, much like dd_frm_type() does.

temporary_tables.cc, sql_table.cc:

When dropping a table, it must be deleted in the engine
first, then frm file. Because frm can be the only true
source of metadata that the engine might need for DROP.

table.cc:

when opening a partitioned table, if the engine for
partitions is not found, do not fallback to MyISAM.
This commit is contained in:
Sergei Golubchik
2022-03-11 20:18:22 +01:00
parent f217c76189
commit bfed2c7d57
10 changed files with 159 additions and 47 deletions

View File

@ -698,19 +698,20 @@ bool THD::rm_temporary_table(handlerton *base, const char *path)
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(0)))
{
error= true;
}
file= get_new_handler((TABLE_SHARE*) 0, current_thd->mem_root, base);
file= get_new_handler((TABLE_SHARE*) 0, mem_root, base);
if (file && file->ha_delete_table(path))
{
error= true;
sql_print_warning("Could not remove temporary table: '%s', error: %d",
path, my_errno);
}
delete file;
if (mysql_file_delete(key_file_frm, frm_path, MYF(0)))
{
error= true;
}
DBUG_RETURN(error);
}