diff options
| author | Sergei Golubchik <serg@mariadb.org> | 2016-01-13 21:06:29 +0100 |
|---|---|---|
| committer | Sergei Golubchik <serg@mariadb.org> | 2016-02-15 13:02:21 +0100 |
| commit | 1fc6e297f26756038c173eb7a1ea722d3a828c42 (patch) | |
| tree | 9546033384b892fc94619eb9f1d76781a1d4244e /storage/innobase/handler | |
| parent | 2c79f57530e0094038c4bebb799df6be602473e3 (diff) | |
| download | mariadb-git-1fc6e297f26756038c173eb7a1ea722d3a828c42.tar.gz | |
XtraDB/InnoDB crash with autoinc, vcol and online alter
Fix the doubly questional fix for MySQL Bug#17250787:
* it detected autoinc index by looking for the first index
that starts from autoinc column. never mind one column
can be part of many indexes.
* it used autoinc_field->field_index to look up into internal
innodb dictionary. But field_index accounts for virtual
columns too, while innodb dictionary ignores them.
Find the index by its name, like elsewhere in ha_innobase.
Diffstat (limited to 'storage/innobase/handler')
| -rw-r--r-- | storage/innobase/handler/handler0alter.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index f8efc38afff..49a9c424287 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -4736,9 +4736,11 @@ commit_get_autoinc( Field* autoinc_field = old_table->found_next_number_field; + KEY* autoinc_key = + old_table->key_info + old_table->s->next_number_index; - dict_index_t* index = dict_table_get_index_on_first_col( - ctx->old_table, autoinc_field->field_index); + dict_index_t* index = dict_table_get_index_on_name( + ctx->old_table, autoinc_key->name); max_autoinc = ha_alter_info->create_info->auto_increment_value; |
