Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-41249

Dropped FULLTEXT helper index remains in mysql.innodb_index_stats

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q4/2026 Server Maintenance

    Description

      • Description
        After creating and dropping a FULLTEXT index, SHOW INDEX and information_schema.STATISTICS correctly report only the primary index. However, mysql.innodb_index_stats still contains the internal FTS_DOC_ID_INDEX.
        This leaves inconsistent index metadata for the same table.
      • Steps to reproduce

        DROP DATABASE IF EXISTS test_ftsstats;
        CREATE DATABASE test_ftsstats;
        USE test_ftsstats;
         
        CREATE TABLE t (
          id INT NOT NULL,
          v VARCHAR(32) NOT NULL,
          PRIMARY KEY (id)
        ) ENGINE=InnoDB;
         
        CREATE FULLTEXT INDEX ft ON t (v);
        DROP INDEX ft ON t;
        TRUNCATE TABLE t;
         
        -- These two lists should be the same index names for t.
        -- STATISTICS / SHOW INDEX: PRIMARY only.
        -- innodb_index_stats still has FTS_DOC_ID_INDEX (the dropped FULLTEXT helper).
         
        SHOW INDEX FROM t;
        -------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
        | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Ignored |
        +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
        | t     |          0 | PRIMARY  |            1 | id          | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
        +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
         
        SELECT DISTINCT INDEX_NAME
        FROM information_schema.STATISTICS
        WHERE TABLE_SCHEMA = 'test_ftsstats' AND TABLE_NAME = 't';
        +------------+
        | INDEX_NAME |
        +------------+
        | PRIMARY    |
        +------------+
         
        SELECT DISTINCT index_name
        FROM mysql.innodb_index_stats
        WHERE database_name = 'test_ftsstats' AND table_name = 't';
        +------------------+
        | index_name       |
        +------------------+
        | FTS_DOC_ID_INDEX |
        | PRIMARY          |
        +------------------+
        

      • Expected behavior
        After the FULLTEXT index is dropped, mysql.innodb_index_stats should no longer contain the internal FTS_DOC_ID_INDEX, consistent with SHOW INDEX and information_schema.STATISTICS.
      • Actual behavior
        FTS_DOC_ID_INDEX remains in mysql.innodb_index_stats even though the corresponding FULLTEXT index has been dropped.

      Attachments

        Activity

          People

            thiru Thirunarayanan Balathandayuthapani
            jinhui lai jinhui lai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0d
                0d
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 1h
                1h

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.