mirror of
https://github.com/MariaDB/server.git
synced 2026-02-03 09:19:07 +01:00
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 |
||
|---|---|---|
| .. | ||
| fts0ast.cc | ||
| fts0blex.cc | ||
| fts0blex.l | ||
| fts0config.cc | ||
| fts0fts.cc | ||
| fts0opt.cc | ||
| fts0pars.cc | ||
| fts0pars.y | ||
| fts0plugin.cc | ||
| fts0que.cc | ||
| fts0sql.cc | ||
| fts0tlex.cc | ||
| fts0tlex.l | ||
| make_parser.sh | ||
| Makefile.query | ||