summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-09-22 13:55:36 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-09-22 13:55:36 +0300
commit78efa1093076307946873f322b45a14d1ed5ffb0 (patch)
treeebd1a0a5ce491aaf436e6ab0fdbd6f7e8377ff69
parent3eb81136e1c087af3fef38ae89e3357f4c306f8d (diff)
downloadmariadb-git-78efa1093076307946873f322b45a14d1ed5ffb0.tar.gz
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!
-rw-r--r--storage/innobase/handler/handler0alter.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index f0b12183b22..7eacb83fa2f 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -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;