Commit 324e5f02 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-24754 Crash in ha_partition_inplace_ctx::~ha_partition_inplace_ctx()

ha_innobase::commit_inplace_alter_table(): Fix a regression that was
introduced in 6d1f1b61 (MDEV-24564).
parent b1241585
......@@ -8,3 +8,11 @@ PARTITION BY RANGE(a)
PARTITION pb VALUES LESS THAN (4));
ERROR HY000: Partitioned tables do not support FOREIGN KEY
DROP TABLE t1;
#
# MDEV-24754 Server crash in
# ha_partition_inplace_ctx::~ha_partition_inplace_ctx
#
CREATE TABLE t1 (id INT PRIMARY KEY, a INT, va INT AS (a) VIRTUAL)
ENGINE=InnoDB PARTITION BY HASH(id) PARTITIONS 2;
ALTER TABLE t1 ADD b INT, ALGORITHM=INSTANT;
DROP TABLE t1;
......@@ -13,3 +13,12 @@ PARTITION BY RANGE(a)
PARTITION pb VALUES LESS THAN (4));
DROP TABLE t1;
--echo #
--echo # MDEV-24754 Server crash in
--echo # ha_partition_inplace_ctx::~ha_partition_inplace_ctx
--echo #
CREATE TABLE t1 (id INT PRIMARY KEY, a INT, va INT AS (a) VIRTUAL)
ENGINE=InnoDB PARTITION BY HASH(id) PARTITIONS 2;
ALTER TABLE t1 ADD b INT, ALGORITHM=INSTANT;
DROP TABLE t1;
......@@ -11271,7 +11271,7 @@ ha_innobase::commit_inplace_alter_table(
auto ctx= static_cast<ha_innobase_inplace_ctx*>(*pctx);
ctx->prebuilt->table = innobase_reload_table(
m_user_thd, ctx->prebuilt->table,
table->s->table_name, *ctx0);
table->s->table_name, *ctx);
innobase_copy_frm_flags_from_table_share(
ctx->prebuilt->table, altered_table->s);
}
......
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