Commit 78efa109 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-22939: Restore an AUTO_INCREMENT check

It turns out that we must check for DISCARD TABLESPACE both
when the table is being rebuilt and when the AUTO_INCREMENT
value of the table is being added.

This was caught by the test innodb.alter_missing_tablespace.
Somehow I failed to run all tests. Sorry!
parent 3eb81136
......@@ -7209,6 +7209,12 @@ commit_set_autoinc(
&& (ha_alter_info->create_info->used_fields
& HA_CREATE_USED_AUTO)) {
if (dict_table_is_discarded(ctx->old_table)) {
my_error(ER_TABLESPACE_DISCARDED, MYF(0),
old_table->s->table_name.str);
DBUG_RETURN(true);
}
/* An AUTO_INCREMENT value was supplied by the user.
It must be persisted to the data file. */
const Field* ai = old_table->found_next_number_field;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment