MDEV-32346 Assertion failure sym_node->table != NULL in pars_retrieve_table_def on UPDATE

- During update operation, InnoDB should avoid the initializing
the FTS_DOC_ID of foreign table if the foreign table is discarded
parent 8532dd82
......@@ -32,3 +32,15 @@ database
database
DROP TABLE t1_fk;
DROP TABLE t1;
#
# MDEV-32346 Assertion failure sym_node->table != NULL
# in pars_retrieve_table_def on UPDATE
#
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (a INT, b TEXT, FOREIGN KEY(a) REFERENCES t1(a),
FULLTEXT (b))ENGINE=InnoDB;
INSERT INTO t1 SET a=1;
ALTER TABLE t2 DISCARD TABLESPACE;
UPDATE t1 SET a=2;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
DROP TABLE t2,t1;
......@@ -32,3 +32,16 @@ SELECT * FROM t1_fk WHERE MATCH(a) AGAINST('database');
DROP TABLE t1_fk;
DROP TABLE t1;
--echo #
--echo # MDEV-32346 Assertion failure sym_node->table != NULL
--echo # in pars_retrieve_table_def on UPDATE
--echo #
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (a INT, b TEXT, FOREIGN KEY(a) REFERENCES t1(a),
FULLTEXT (b))ENGINE=InnoDB;
INSERT INTO t1 SET a=1;
ALTER TABLE t2 DISCARD TABLESPACE;
--error ER_ROW_IS_REFERENCED_2
UPDATE t1 SET a=2;
DROP TABLE t2,t1;
......@@ -1689,7 +1689,8 @@ init_fts_doc_id_for_ref(
ut_ad(foreign->foreign_table != NULL);
if (foreign->foreign_table->fts != NULL) {
if (foreign->foreign_table->space
&& foreign->foreign_table->fts) {
fts_init_doc_id(foreign->foreign_table);
}
......
Subproject commit 6a17207b7f44379cdcd73d69203c1a37b901c9d3
Subproject commit a5d95f0175f10b6127ea039c542725f6c4aa5cb9
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