MDEV-14076 InnoDB: Failing assertion when accessing INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES upon upgrade from 10.1.0 to 10.1.20

i_s_dict_fill_sys_tablespaces(): Adjust the tablespace flags if needed.
This commit is contained in:
Marko Mäkelä 2017-10-16 20:54:07 +03:00
parent 98cd0ec536
commit d11af09865
2 changed files with 26 additions and 20 deletions

View file

@ -7722,8 +7722,6 @@ i_s_dict_fill_sys_tablespaces(
{
Field** fields;
ulint atomic_blobs = FSP_FLAGS_HAS_ATOMIC_BLOBS(flags);
ulint page_size = fsp_flags_get_page_size(flags);
ulint zip_size = fsp_flags_get_zip_size(flags);
const char* file_format;
const char* row_format;
@ -7740,13 +7738,11 @@ i_s_dict_fill_sys_tablespaces(
fields = table_to_fill->field;
OK(fields[SYS_TABLESPACES_SPACE]->store(
static_cast<double>(space)));
OK(fields[SYS_TABLESPACES_SPACE]->store(space, true));
OK(field_store_string(fields[SYS_TABLESPACES_NAME], name));
OK(fields[SYS_TABLESPACES_FLAGS]->store(
static_cast<double>(flags)));
OK(fields[SYS_TABLESPACES_FLAGS]->store(flags, true));
OK(field_store_string(fields[SYS_TABLESPACES_FILE_FORMAT],
file_format));
@ -7754,11 +7750,18 @@ i_s_dict_fill_sys_tablespaces(
OK(field_store_string(fields[SYS_TABLESPACES_ROW_FORMAT],
row_format));
OK(fields[SYS_TABLESPACES_PAGE_SIZE]->store(
static_cast<double>(page_size)));
ulint cflags = fsp_flags_is_valid(flags, space)
? flags : fsp_flags_convert_from_101(flags);
if (cflags != ULINT_UNDEFINED) {
OK(fields[SYS_TABLESPACES_PAGE_SIZE]->store(
fsp_flags_get_page_size(cflags), true));
OK(fields[SYS_TABLESPACES_ZIP_PAGE_SIZE]->store(
static_cast<double>(zip_size)));
OK(fields[SYS_TABLESPACES_ZIP_PAGE_SIZE]->store(
fsp_flags_get_zip_size(cflags), true));
} else {
fields[SYS_TABLESPACES_PAGE_SIZE]->set_null();
fields[SYS_TABLESPACES_ZIP_PAGE_SIZE]->set_null();
}
OK(schema_table_store_record(thd, table_to_fill));

View file

@ -7690,8 +7690,6 @@ i_s_dict_fill_sys_tablespaces(
{
Field** fields;
ulint atomic_blobs = FSP_FLAGS_HAS_ATOMIC_BLOBS(flags);
ulint page_size = fsp_flags_get_page_size(flags);
ulint zip_size = fsp_flags_get_zip_size(flags);
const char* file_format;
const char* row_format;
@ -7708,13 +7706,11 @@ i_s_dict_fill_sys_tablespaces(
fields = table_to_fill->field;
OK(fields[SYS_TABLESPACES_SPACE]->store(
static_cast<double>(space)));
OK(fields[SYS_TABLESPACES_SPACE]->store(space, true));
OK(field_store_string(fields[SYS_TABLESPACES_NAME], name));
OK(fields[SYS_TABLESPACES_FLAGS]->store(
static_cast<double>(flags)));
OK(fields[SYS_TABLESPACES_FLAGS]->store(flags, true));
OK(field_store_string(fields[SYS_TABLESPACES_FILE_FORMAT],
file_format));
@ -7722,11 +7718,18 @@ i_s_dict_fill_sys_tablespaces(
OK(field_store_string(fields[SYS_TABLESPACES_ROW_FORMAT],
row_format));
OK(fields[SYS_TABLESPACES_PAGE_SIZE]->store(
static_cast<double>(page_size)));
ulint cflags = fsp_flags_is_valid(flags, space)
? flags : fsp_flags_convert_from_101(flags);
if (cflags != ULINT_UNDEFINED) {
OK(fields[SYS_TABLESPACES_PAGE_SIZE]->store(
fsp_flags_get_page_size(cflags), true));
OK(fields[SYS_TABLESPACES_ZIP_PAGE_SIZE]->store(
static_cast<double>(zip_size)));
OK(fields[SYS_TABLESPACES_ZIP_PAGE_SIZE]->store(
fsp_flags_get_zip_size(cflags), true));
} else {
fields[SYS_TABLESPACES_PAGE_SIZE]->set_null();
fields[SYS_TABLESPACES_ZIP_PAGE_SIZE]->set_null();
}
OK(schema_table_store_record(thd, table_to_fill));