MDEV-26621 assertion failue "index->table->persistent_autoinc" in /storage/innobase/btr/btr0btr.cc during IMPORT

dict_index_t::clear_instant_alter(): when searhing for an AUTO_INCREMENT column
don't skip the beginning of the list because the field can be at the beginning of the list
This commit is contained in:
Eugene Kosov 2021-09-16 16:52:20 +06:00
commit 5b0a76078a
3 changed files with 28 additions and 1 deletions

View file

@ -2440,7 +2440,7 @@ inline void dict_index_t::clear_instant_alter()
{ return a.col->ind < b.col->ind; });
table->instant = NULL;
if (ai_col) {
auto a = std::find_if(begin, end,
auto a = std::find_if(fields, end,
[ai_col](const dict_field_t& f)
{ return f.col == ai_col; });
table->persistent_autoinc = (a == end) ? 0 : 1 + (a - fields);