Bug:CHECK INDEX assert failure on tables with FULLTEXT index

Open Beginner friendly
#57 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
cpp, mysql
Domain
databases

Research direction

Start at the ha_innobase::check_index() entry point and compare handling of DICT_FTS with the hidden FTS_DOC_ID_INDEX. Reproduce the provided CREATE TABLE and CHECK INDEX commands, then confirm the command no longer asserts and emits a warning for the skipped index.

Written by the indexing model from the issue text.

Description

Problem

Running CHECK INDEX on an InnoDB table with a FULLTEXT index triggers an assert failure.

Root Cause

In ha_innobase::check_index(), the loop only skips indexes with DICT_FTS type flag, but does not skip the hidden FTS_DOC_ID_INDEX — a regular B-tree index created internally by InnoDB for FTS document ID lookups. When check_index tries to get physical info for this index, it asserts.

Reproduce

CREATE TABLE fts_test (
id bigint NOT NULL,
tran_time varchar(20) NOT NULL,
body text,
PRIMARY KEY (id, tran_time),
FULLTEXT KEY (tran_time, body)
) ENGINE=InnoDB;

CHECK INDEX FROM fts_test; -- assert failure

Fix

Skip FTS_DOC_ID_INDEX in the loop and emit a warning, same as done for DICT_FTS indexes.

Dominant language
C++
Stars
712
Forks
428
Avg merge
5h 43m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenTenBase/TXSQL

All issues in OpenTenBase/TXSQL

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.