Commit be254148 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-18016: Cover the no-rebuild case, and remove a bogus debug assertion

The code path where the table was not being rebuilt during ALTER TABLE
was not covered by the test. Add coverage, and remove the debug assertion
that could fail in this case.
parent af3cbb51
......@@ -82,3 +82,13 @@ ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
Warnings:
Warning 1088 failed to load FOREIGN KEY constraints
DROP TABLE t1;
CREATE TABLE t1 (f VARCHAR(256), FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY)
ENGINE=InnoDB;
SET SESSION FOREIGN_KEY_CHECKS = OFF;
ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
SET SESSION FOREIGN_KEY_CHECKS = ON;
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
Warnings:
Warning 1088 failed to load FOREIGN KEY constraints
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
DROP TABLE t1;
......@@ -104,3 +104,12 @@ SET SESSION FOREIGN_KEY_CHECKS = ON;
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
DROP TABLE t1;
CREATE TABLE t1 (f VARCHAR(256), FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY)
ENGINE=InnoDB;
SET SESSION FOREIGN_KEY_CHECKS = OFF;
ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
SET SESSION FOREIGN_KEY_CHECKS = ON;
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
DROP TABLE t1;
......@@ -6163,7 +6163,6 @@ ha_innobase::commit_inplace_alter_table(
if (!commit_cache_norebuild(ctx, table, trx)) {
fk_fail = true;
ut_ad(!prebuilt->trx->check_foreigns);
}
innobase_rename_columns_cache(ha_alter_info, table,
......
......@@ -6181,7 +6181,6 @@ ha_innobase::commit_inplace_alter_table(
if (!commit_cache_norebuild(ctx, table, trx)) {
fk_fail = true;
ut_ad(!prebuilt->trx->check_foreigns);
}
innobase_rename_columns_cache(ha_alter_info, table,
......
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