diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-13 21:25:12 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-13 21:25:12 +0200 |
commit | e3dda3d95ee4c09c2ed45ce886ecd25d1fc1ae92 (patch) | |
tree | 1c309791302a4c69526248a28a4b2e637f96f27d /storage/innobase/include/dict0dict.ic | |
parent | 1a780eefc9ff8050b44bca07c981bd6a42bdbaf6 (diff) | |
download | mariadb-git-e3dda3d95ee4c09c2ed45ce886ecd25d1fc1ae92.tar.gz |
MDEV-17989 InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)
With innodb_default_row_format=redundant, InnoDB would crash when
using table options that are incompatible with ROW_FORMAT=REDUNDANT.
create_table_info_t::m_default_row_format: Cache the value of
innodb_default_row_format.
create_table_info_t::check_table_options(): Validate ROW_TYPE_DEFAULT
with m_default_row_format.
create_table_info_t::innobase_table_flags(): Use the
cached m_default_row_format.
create_table_info_t: Never read m_form->s->row_type.
Use m_create_info->row_type instead.
dict_tf_set(): Never set invalid flags for ROW_FORMAT=REDUNDANT.
ha_innobase::truncate(): Set info.row_type based on the ROW_FORMAT
of the current table.
Diffstat (limited to 'storage/innobase/include/dict0dict.ic')
-rw-r--r-- | storage/innobase/include/dict0dict.ic | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 337ded84f5f..a10bf769773 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -727,31 +727,30 @@ dict_tf_set( ulint page_compression_level, ulint not_used) { + *flags = use_data_dir ? 1 << DICT_TF_POS_DATA_DIR : 0; + switch (format) { case REC_FORMAT_REDUNDANT: - *flags = 0; ut_ad(zip_ssize == 0); - break; + /* no other options are allowed */ + ut_ad(!page_compressed); + return; case REC_FORMAT_COMPACT: - *flags = DICT_TF_COMPACT; + *flags |= DICT_TF_COMPACT; ut_ad(zip_ssize == 0); break; case REC_FORMAT_COMPRESSED: - *flags = DICT_TF_COMPACT + *flags |= DICT_TF_COMPACT | (1 << DICT_TF_POS_ATOMIC_BLOBS) | (zip_ssize << DICT_TF_POS_ZIP_SSIZE); break; case REC_FORMAT_DYNAMIC: - *flags = DICT_TF_COMPACT + *flags |= DICT_TF_COMPACT | (1 << DICT_TF_POS_ATOMIC_BLOBS); ut_ad(zip_ssize == 0); break; } - if (use_data_dir) { - *flags |= (1 << DICT_TF_POS_DATA_DIR); - } - if (page_compressed) { *flags |= (1 << DICT_TF_POS_ATOMIC_BLOBS) | (1 << DICT_TF_POS_PAGE_COMPRESSION) |