summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-10-16 20:54:07 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-10-16 20:54:07 +0300
commitd11af09865299033d5eef64531704f6ab8af5304 (patch)
treed8a332f6b9d1430fbdf4ed823e5b8398058c5fae
parent98cd0ec536915b25a841ffc227285b15f35acef7 (diff)
downloadmariadb-git-d11af09865299033d5eef64531704f6ab8af5304.tar.gz
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.
-rw-r--r--storage/innobase/handler/i_s.cc23
-rw-r--r--storage/xtradb/handler/i_s.cc23
2 files changed, 26 insertions, 20 deletions
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index 145100c8838..cc64fb9f1e8 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -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));
diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc
index ca2c76c31ad..fe0fd0c73ed 100644
--- a/storage/xtradb/handler/i_s.cc
+++ b/storage/xtradb/handler/i_s.cc
@@ -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));