MDEV-25257 SEGV in fts_get_next_doc_id upon some INSERT

- InnoDB fails to create a fts cache while loading the innodb fts
table which is stored in system tablespace. InnoDB should create
the fts cache while loading FTS_DOC_ID column from system column.
parent 7d3d3838
......@@ -718,4 +718,18 @@ t1 CREATE TABLE `t1` (
FULLTEXT KEY `a_2` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# MDEV-25257 SEGV in fts_get_next_doc_id upon some INSERT
#
SET @save = @@global.innodb_file_per_table;
SET @@global.innodb_file_per_table = 0;
CREATE TABLE t1 (
col_int INTEGER, col_text TEXT,
col_int_g INTEGER GENERATED ALWAYS AS (col_int)
) ENGINE = InnoDB ROW_FORMAT = Redundant ;
ALTER TABLE t1 ADD FULLTEXT KEY `ftidx` ( col_text ) ;
ALTER TABLE t1 DROP KEY `ftidx` ;
INSERT INTO t1 (col_int, col_text) VALUES ( 1255, NULL);
DROP TABLE t1;
SET @@global.innodb_file_per_table = @save;
# End of 10.3 tests
......@@ -741,4 +741,20 @@ ALTER TABLE t1 ADD FULLTEXT INDEX (a);
SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
--echo # MDEV-25257 SEGV in fts_get_next_doc_id upon some INSERT
--echo #
SET @save = @@global.innodb_file_per_table;
SET @@global.innodb_file_per_table = 0;
CREATE TABLE t1 (
col_int INTEGER, col_text TEXT,
col_int_g INTEGER GENERATED ALWAYS AS (col_int)
) ENGINE = InnoDB ROW_FORMAT = Redundant ;
ALTER TABLE t1 ADD FULLTEXT KEY `ftidx` ( col_text ) ;
ALTER TABLE t1 DROP KEY `ftidx` ;
INSERT INTO t1 (col_int, col_text) VALUES ( 1255, NULL);
DROP TABLE t1;
SET @@global.innodb_file_per_table = @save;
--echo # End of 10.3 tests
......@@ -1851,6 +1851,7 @@ dict_load_columns(
the flag is set before the table is created. */
if (table->fts == NULL) {
table->fts = fts_create(table);
table->fts->cache = fts_cache_create(table);
fts_optimize_add_table(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