Skip to content

Commit 15a68fc

Browse files
MDEV-29058 Assertion `index->type == 32' failed in dict_index_build_internal_fts
- Import tablespace re-evicts and reload the table definition. During that time, innodb has to load the table even though the secondary fts index marked as corrupted
1 parent f076dc2 commit 15a68fc

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

mysql-test/suite/innodb_fts/r/fulltext.result

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,4 +760,18 @@ Brien
760760
O 'Brien
761761
O' Brien
762762
DROP TABLE t1;
763+
#
764+
# MDEV-29058 Assertion `index->type == 32' failed
765+
# in dict_index_build_internal_fts
766+
#
767+
call mtr.add_suppression("InnoDB: Index `f` of table `test`.`t2` is corrupted");
768+
call mtr.add_suppression("InnoDB: Skip adjustment of root pages for index `f`.");
769+
CREATE TABLE t1 (f CHAR(8), FULLTEXT KEY (f)) ENGINE=InnoDB;
770+
CREATE TABLE t2 LIKE t1;
771+
ALTER TABLE t2 DISCARD TABLESPACE;
772+
FLUSH TABLES t1 FOR EXPORT;
773+
UNLOCK TABLES;
774+
ALTER TABLE t1 DISCARD TABLESPACE;
775+
ALTER TABLE t2 IMPORT TABLESPACE;
776+
DROP TABLE t2, t1;
763777
# End of 10.3 tests

mysql-test/suite/innodb_fts/t/fulltext.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,4 +770,24 @@ SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+Doh'nuts" IN BOOLEAN MODE);
770770
SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+�''Brien" IN BOOLEAN MODE);
771771
DROP TABLE t1;
772772

773+
--echo #
774+
--echo # MDEV-29058 Assertion `index->type == 32' failed
775+
--echo # in dict_index_build_internal_fts
776+
--echo #
777+
call mtr.add_suppression("InnoDB: Index `f` of table `test`.`t2` is corrupted");
778+
call mtr.add_suppression("InnoDB: Skip adjustment of root pages for index `f`.");
779+
let $MYSQLD_DATADIR = `SELECT @@datadir`;
780+
CREATE TABLE t1 (f CHAR(8), FULLTEXT KEY (f)) ENGINE=InnoDB;
781+
CREATE TABLE t2 LIKE t1;
782+
ALTER TABLE t2 DISCARD TABLESPACE;
783+
--disable_warnings
784+
FLUSH TABLES t1 FOR EXPORT;
785+
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
786+
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
787+
UNLOCK TABLES;
788+
ALTER TABLE t1 DISCARD TABLESPACE;
789+
ALTER TABLE t2 IMPORT TABLESPACE;
790+
--enable_warnings
791+
DROP TABLE t2, t1;
792+
773793
--echo # End of 10.3 tests

storage/innobase/dict/dict0dict.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2720,7 +2720,7 @@ dict_index_build_internal_fts(
27202720
{
27212721
dict_index_t* new_index;
27222722

2723-
ut_ad(index->type == DICT_FTS);
2723+
ut_ad(index->type & DICT_FTS);
27242724
ut_ad(mutex_own(&dict_sys->mutex));
27252725

27262726
/* Create a new index */

0 commit comments

Comments
 (0)