Skip to content
Permalink
Browse files
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.
  • Loading branch information
Thirunarayanan committed May 25, 2022
1 parent 7d3d383 commit 7fe474f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
@@ -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);
}

0 comments on commit 7fe474f

Please sign in to comment.