diff options
author | Sergei Golubchik <serg@mariadb.org> | 2022-03-11 20:18:22 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-03-14 08:55:59 +0100 |
commit | bfed2c7d57a7ca34936d6ef0688af7357592dc40 (patch) | |
tree | 39b29c2bbbdc3276abb4c1e4ca0e789bea740a2e /sql/unireg.h | |
parent | f217c761892683403b65da75b2f2abb8ebd295b2 (diff) | |
download | mariadb-git-bfed2c7d57a7ca34936d6ef0688af7357592dc40.tar.gz |
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.
Diffstat (limited to 'sql/unireg.h')
-rw-r--r-- | sql/unireg.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/unireg.h b/sql/unireg.h index e9c62334e86..03d63d0fd06 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -188,6 +188,21 @@ enum extra2_field_flags { VERS_OPTIMIZED_UPDATE= 1 << INVISIBLE_MAX_BITS }; +static inline size_t extra2_read_len(const uchar **extra2, const uchar *end) +{ + size_t length= *(*extra2)++; + if (length) + return length; + + if ((*extra2) + 2 >= end) + return 0; + length= uint2korr(*extra2); + (*extra2)+= 2; + if (length < 256 || *extra2 + length > end) + return 0; + return length; +} + int rea_create_table(THD *thd, LEX_CUSTRING *frm, const char *path, const char *db, const char *table_name, HA_CREATE_INFO *create_info, handler *file, |