MDEV-25070 SIGSEGV in fts_create_in_mem_aux_table

InnoDB set the space in dict_table_t as NULL when table
is discarded. So InnoDB shouldn't use the space present
in table to detect whether the given tablespace is
temporary tablespace.
parent 75f781f0
......@@ -689,3 +689,19 @@ FTS_DOC_ID t
2 foo bar
3 foo
DROP TABLE t;
#
# MDEV-25070 SIGSEGV in fts_create_in_mem_aux_table
#
CREATE TABLE t1 (a CHAR, FULLTEXT KEY(a)) ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
ALTER TABLE t1 ADD FULLTEXT INDEX (a);
Warnings:
Warning 1814 Tablespace has been discarded for table `t1`
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(1) DEFAULT NULL,
FULLTEXT KEY `a` (`a`),
FULLTEXT KEY `a_2` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
......@@ -717,3 +717,12 @@ while ($N)
}
DROP TABLE t;
--echo #
--echo # MDEV-25070 SIGSEGV in fts_create_in_mem_aux_table
--echo #
CREATE TABLE t1 (a CHAR, FULLTEXT KEY(a)) ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
ALTER TABLE t1 ADD FULLTEXT INDEX (a);
SHOW CREATE TABLE t1;
DROP TABLE t1;
......@@ -1730,7 +1730,7 @@ fts_create_in_mem_aux_table(
dict_table_t* new_table = dict_mem_table_create(
aux_table_name, NULL, n_cols, 0, table->flags,
table->space_id == TRX_SYS_SPACE
? 0 : table->space->purpose == FIL_TYPE_TEMPORARY
? 0 : table->space_id == SRV_TMP_SPACE_ID
? DICT_TF2_TEMPORARY : DICT_TF2_USE_FILE_PER_TABLE);
if (DICT_TF_HAS_DATA_DIR(table->flags)) {
......
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