diff options
Diffstat (limited to 'storage/innobase/dict/dict0mem.cc')
-rw-r--r-- | storage/innobase/dict/dict0mem.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index 2741e29740a..6b1f837634b 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -1211,8 +1211,9 @@ bool dict_foreign_t::affects_fulltext() const return false; } -/** Reconstruct the clustered index fields. */ -inline void dict_index_t::reconstruct_fields() +/** Reconstruct the clustered index fields. +@return whether metadata is incorrect */ +inline bool dict_index_t::reconstruct_fields() { DBUG_ASSERT(is_primary()); @@ -1243,10 +1244,14 @@ inline void dict_index_t::reconstruct_fields() fields + n_first, fields + n_fields, [c](const dict_field_t& o) { return o.col->ind == c.ind(); }); + + if (old >= fields + n_fields + || old->prefix_len + || old->col != &table->cols[c.ind()]) { + return true; + } + ut_ad(old >= &fields[n_first]); - ut_ad(old < &fields[n_fields]); - DBUG_ASSERT(!old->prefix_len); - DBUG_ASSERT(old->col == &table->cols[c.ind()]); f = *old; } @@ -1259,6 +1264,8 @@ inline void dict_index_t::reconstruct_fields() fields = tfields; n_core_null_bytes = UT_BITS_IN_BYTES(n_core_null); + + return false; } /** Reconstruct dropped or reordered columns. @@ -1323,8 +1330,7 @@ bool dict_table_t::deserialise_columns(const byte* metadata, ulint len) } DBUG_ASSERT(col == &dropped_cols[n_dropped_cols]); - UT_LIST_GET_FIRST(indexes)->reconstruct_fields(); - return false; + return UT_LIST_GET_FIRST(indexes)->reconstruct_fields(); } /** Check if record in clustered index is historical row. |