mariadb/storage/innobase/fts
Thirunarayanan Balathandayuthapani accb4af95b MDEV-31892 Server crash upon moving InnoDB table with
fulltext index between databases

Problem:
========
- When renaming/moving an InnoDB table with fulltext indexes
between databases, the server would crash because
InnoDB attempted to open auxiliary tables using
the old database name instead of the new one.

When creating auxiliary index, InnoDB does create temporary
sort fulltext index using old table reference which creates
the auxiliary table name with the prefix of old database name.

FTS Document ID size optimization in row_merge_create_fts_sort_index()
using dict_table_get_n_rows() to decide between 4-byte
and 8-byte Doc IDs for memory optimization. But
dict_table_get_n_rows() returns estimated statistics that
may be stale or inaccurate, potentially leading to wrong
size decisions and data corruption if 4-byte
Doc IDs are chosen when 8-byte are actually needed.

Solution:
=========
fts_rename_aux_tables(): Iterate through all table indexes
and ensure all fulltext indexes are properly renamed

row_merge_create_fts_sort_index() : Use new_table instead
of old_table when creating temporary FTS sort indexes.

row_merge_build_indexes(): Refactored the logic to do
memory optimization to determine the doc id size for
temporary fts sort index.

 - When adding FTS index for the first time
  (DICT_TF2_FTS_ADD_DOC_ID), always use 8-byte Doc IDs

 - For existing FTS tables or user-supplied Doc ID columns,
   use fts_get_max_doc_id() approach to check actual maximum Doc ID
2026-01-09 21:15:14 +05:30
..
fts0ast.cc MDEV-24402: InnoDB CHECK TABLE ... EXTENDED 2022-10-21 10:02:54 +03:00
fts0blex.cc Removed some warnings from InnoDB when compiled with clang 2019-08-23 22:03:54 +02:00
fts0blex.l Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
fts0config.cc MDEV-36061 Incorrect error handling on DDL with FULLTEXT INDEX 2025-02-13 16:28:06 +01:00
fts0fts.cc MDEV-31892 Server crash upon moving InnoDB table with 2026-01-09 21:15:14 +05:30
fts0opt.cc Merge 10.5 into 10.6 2024-02-13 20:42:59 +02:00
fts0pars.cc MDEV-31890: Remove COMPILE_FLAGS 2023-10-11 15:59:56 +03:00
fts0pars.y MDEV-31890: Remove COMPILE_FLAGS 2023-10-11 15:59:56 +03:00
fts0plugin.cc Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
fts0que.cc Merge 10.5 into 10.6 2024-02-13 20:42:59 +02:00
fts0sql.cc MDEV-24258 Merge dict_sys.mutex into dict_sys.latch 2021-08-31 13:51:35 +03:00
fts0tlex.cc Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
fts0tlex.l Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
make_parser.sh Update FSF address 2019-05-11 19:25:02 +03:00
Makefile.query Merge 10.1 into 10.2 2019-04-02 09:14:15 +03:00