From bfed2c7d57a7ca34936d6ef0688af7357592dc40 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 11 Mar 2022 20:18:22 +0100 Subject: 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. --- sql/ha_partition.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/ha_partition.h') diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 48552301f55..36e18d15c0a 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -580,8 +580,9 @@ private: And one method to read it in. */ bool create_handler_file(const char *name); - bool setup_engine_array(MEM_ROOT *mem_root); + bool setup_engine_array(MEM_ROOT *mem_root, handlerton *first_engine); bool read_par_file(const char *name); + handlerton *get_def_part_engine(const char *name); bool get_from_handler_file(const char *name, MEM_ROOT *mem_root, bool is_clone); bool new_handlers_from_part_info(MEM_ROOT *mem_root); -- cgit v1.2.1