mariadb/storage/innobase/include
Thirunarayanan Balathandayuthapani dfa7fe347f MDEV-28730 Remove internal parser usage from InnoDB fulltext
- Introduce a class FTSQueryRunner to handle queries for fulltext
internal tables. Basically it creates a query, prepares the
fulltext internal table for read or write process. Build a tuple
based on the given table and assign the FTS_CONFIG, FTS_COMMON_TABLES
and FTS_AUX_TABLE fields based on the given value. This class
also handles INSERT, DELETE, REPLACE, UPDATE and
execute the function for each record (record_executor).

FTSQueryRunner::create_query_thread(): Create a query thread to execute
the statement on internal FULLTEXT tables

FTSQueryRunner::build_tuple(): Build a tuple for the operation

FTSQueryRunner::build_clust_ref(): Build a clustered index reference
for clustered index lookup for the secondary index record

FTSQueryRunner::assign_config_fields(): Assign the tuple for the
FTS CONFIG internal table

FTSQueryRunner::assign_common_table_fields(): Assign the tuple for
FTS_DELETED, FTS_DELETED_CACHE, FTS_BEGIN_DELETED,
FTS_BEGIN_DELETED_CACHE common tables

FTSQueryRunner::assign_aux_table_fields(): Assign the tuple for
FTS_PREFIX_INDEX tables.

FTSQueryRunner::handle_error(): Handling error for DB_LOCK_WAIT,
retry the operation

FTSQueryRunner::open_table(): Open the table based on the fulltext
auxiliary table name and FTS common table name

FTSQueryRunner::prepare_for_write(): Lock the table for write
process by taking Intention Exclusive lock

FTSQueryRunner::prepare_for_read(): Lock the table for read
process by taking Intention Shared lock

FTSQueryRunner::write_record(): Insert the tuple into the given table

FTSQueryRunner::lock_or_sees_rec(): Lock the record in case of
DELETE, SELECT_UPDATE operation. Fetch the correct version of record in
case of READ operation. It also does clustered index lookup in case
of search is on secondary index

fts_cmp_rec_dtuple_prefix(): Compare the record with given tuple field
for tuple field length

FTSQueryRunner::record_executor(): Read the record of the given index and
do call the callback function for each record

FTSQueryRunner::build_update_config(): Build the update vector for
FULLTEXT CONFIG table

FTSQueryRunner::update_record(): Update the record with update vector
exist in FTSQueryRunner

Removed the fts_parse_sql(), fts_eval_sql(), fts_get_select_columns_str()
and fts_get_docs_clear().

Moved fts_get_table_id() & fts_get_table_name() from fts0sql.cc to
fts0fts.cc and deleted the file fts0sql.cc

Removed ins_graph, sel_graph from fts_index_cache_t

Changed the callback function default read function parameter for
each clustered index record to

bool fts_sql_callback(dict_index_t*, const rec_t *, const rec_offs*,
                      void *);

Following parameters are changed to default read function parameter:

fts_read_stopword()
fts_fetch_store_doc_id()
fts_query_expansion_fetch_doc()
fts_read_count()
fts_get_rows_count()
fts_init_doc_id()
fts_init_recover_doc()
read_fts_config()
fts_optimize_read_node()
fts_optimize_index_fetch_node()
fts_index_fetch_nodes()
fts_fetch_index_words()
fts_index_fetch_words()
fts_fetch_doc_ids()
fts_table_fetch_doc_ids()
fts_read_ulint()
fts_copy_doc_ids()
fts_optimize_create_deleted_doc_id_snapshot()
fts_query_index_fetch_nodes()
fts_query_fetch_document()
fts_query_index_fetch_nodes()

row_upd_clust_rec_low(): Function does updates a clustered
index record of a row when ordering fields don't change.
Function doesn't have dependency on row_prebuilt_t. This can be
used by fulltext internal table update operation

Row_sel_get_clust_rec_for_mysql::operator(): Removed the
parameter row_prebuilt_t and caller does pass the prebuilt
related variables

Removed the parser usage and execute the query directly on
fulltext internal tables in the following function:

fts_read_stopword()
fts_fetch_store_doc_id()
fts_query_expansion_fetch_doc()
fts_read_count()
fts_get_rows_count()
fts_init_doc_id()
fts_init_recover_doc()
read_fts_config()
fts_optimize_read_node()
fts_optimize_index_fetch_node()
fts_index_fetch_nodes()
fts_fetch_index_words()
fts_index_fetch_words()
fts_fetch_doc_ids()
fts_table_fetch_doc_ids()
fts_read_ulint()
fts_copy_doc_ids()
fts_optimize_create_deleted_doc_id_snapshot()
fts_query_index_fetch_nodes()
fts_query_fetch_document()
fts_query_index_fetch_nodes()
i_s_fts_deleted_generic_fill()
i_s_fts_index_table_fill_selected()
2025-05-26 16:35:18 +05:30
..
btr0btr.h Merge 10.11 into 11.4 2024-12-02 11:35:34 +02:00
btr0btr.inl MDEV-29603 btr_cur_open_at_index_side() is missing some consistency checks 2022-11-17 08:19:01 +02:00
btr0bulk.h MDEV-13542: Crashing on corrupted page is unhelpful 2022-06-06 14:03:22 +03:00
btr0cur.h MDEV-35049: Fix bogus BTR_CUR_HASH_FAIL on contention 2025-01-10 16:40:30 +02:00
btr0cur.inl MDEV-34515: Contention between purge and workload 2024-08-26 12:23:06 +03:00
btr0pcur.h Merge 10.5 into 10.6 2024-04-19 16:01:26 +03:00
btr0pcur.inl MDEV-35049: Use CRC-32C and avoid allocating heap 2025-01-10 16:39:44 +02:00
btr0sea.h Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
btr0types.h MDEV-35049: btr_search_check_free_space_in_heap() is a bottleneck 2025-01-10 16:30:42 +02:00
buf0buddy.h MDEV-29445: Reimplement SET GLOBAL innodb_buffer_pool_size 2025-03-26 17:05:44 +02:00
buf0buf.h Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
buf0buf.inl MDEV-29445: Reimplement SET GLOBAL innodb_buffer_pool_size 2025-03-26 17:05:44 +02:00
buf0checksum.h MDEV-35049: Privatize ut_fold_ulint_pair() 2025-01-10 16:40:22 +02:00
buf0dblwr.h Merge 10.11 into 11.4 2025-04-02 10:15:08 +03:00
buf0dump.h
buf0flu.h Merge branch '10.6' into 10.11 2025-01-10 13:14:42 +01:00
buf0lru.h Merge 10.11 into 11.4 2025-03-28 13:55:21 +02:00
buf0rea.h Merge branch '10.11' into 11.4 2025-01-14 23:45:41 +01:00
buf0types.h Merge branch '10.6' into 10.11 2025-01-10 13:14:42 +01:00
cache.h MDEV-33447 fixup for POWER 8 2024-04-24 12:39:30 +03:00
data0data.h MDEV-35049: Use CRC-32C and avoid allocating heap 2025-01-10 16:39:44 +02:00
data0data.inl MDEV-35049: Use CRC-32C and avoid allocating heap 2025-01-10 16:39:44 +02:00
data0type.h MDEV-29694 Remove the InnoDB change buffer 2023-01-11 17:59:36 +02:00
data0type.inl MDEV-29694 Remove the InnoDB change buffer 2023-01-11 17:59:36 +02:00
data0types.h
db0err.h MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure 2024-12-12 18:02:00 +02:00
dict0boot.h Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
dict0crea.h MDEV-34823 Invalid arguments in ib_push_warning() 2024-09-06 14:29:09 +03:00
dict0crea.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
dict0dict.h Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
dict0dict.inl Merge 11.4 into 11.8 2025-03-05 20:39:47 +02:00
dict0load.h MDEV-34529 Shrink the system tablespace when system tablespace contains MDEV-30671 leaked undo pages 2024-10-16 21:34:24 +05:30
dict0mem.h Merge 11.4 into 11.8 2025-03-05 20:39:47 +02:00
dict0mem.inl Merge 10.5 into 10.6 2024-04-17 14:14:58 +03:00
dict0pagecompress.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
dict0pagecompress.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
dict0stats.h Merge 10.11 into 11.4 2025-03-03 11:07:56 +02:00
dict0stats_bg.h Merge 10.5 into 10.6 2022-04-26 15:21:20 +03:00
dict0types.h Merge branch '11.4' into 11.7 2025-02-06 16:46:36 +01:00
dyn0buf.h Merge branch '10.6' into 10.11 2024-04-22 15:23:10 +02:00
dyn0types.h Merge from 10.4 to 10.5 2024-04-15 17:46:49 +02:00
eval0eval.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
eval0eval.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
eval0proc.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
eval0proc.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
fil0crypt.h Merge branch '10.6' into 10.11 2024-08-03 09:15:40 +02:00
fil0crypt.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
fil0fil.h Merge branch '10.11' into 11.4 2025-01-14 23:45:41 +01:00
fil0pagecompress.h Merge 10.6 into 10.7 2021-08-19 13:03:48 +03:00
fsp0file.h Merge 10.11 into 11.2 2024-10-18 11:32:22 +03:00
fsp0fsp.h Merge 10.11 into 11.4 2025-03-03 11:07:56 +02:00
fsp0space.h MDEV-26195: Use a 32-bit data type for some tablespace fields 2021-07-22 11:22:47 +03:00
fsp0sysspace.h MDEV-34529 Shrink the system tablespace when system tablespace contains MDEV-30671 leaked undo pages 2024-10-16 21:34:24 +05:30
fsp0types.h MDEV-29694 Remove the InnoDB change buffer 2023-01-11 17:59:36 +02:00
fts0ast.h
fts0blex.h
fts0fts.h Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
fts0opt.h MDEV-28730 Remove internal parser usage from InnoDB fulltext 2025-05-26 16:35:18 +05:30
fts0pars.h
fts0plugin.h
fts0priv.h MDEV-28730 Remove internal parser usage from InnoDB fulltext 2025-05-26 16:35:18 +05:30
fts0priv.inl MDEV-33383: Corrupted red-black tree due to incorrect comparison 2024-02-12 17:01:45 +02:00
fts0tlex.h
fts0tokenize.h
fts0types.h MDEV-28730 Remove internal parser usage from InnoDB fulltext 2025-05-26 16:35:18 +05:30
fts0types.inl Merge branch '11.4' into 11.5 2024-05-23 17:01:43 +02:00
fts0vlc.h MDEV-19522 InnoDB commit fails when FTS_DOC_ID value is greater than 4294967295 2021-10-21 12:56:59 +03:00
fut0lst.h Merge branch '11.1' into 11.2 2024-05-13 10:00:26 +02:00
gis0geo.h
gis0rtree.h Merge 10.11 into 11.0 2023-01-25 10:17:54 +02:00
gis0rtree.inl MDEV-29694 Remove the InnoDB change buffer 2023-01-11 17:59:36 +02:00
gis0type.h Merge 10.5 into 10.6 2024-04-17 14:14:58 +03:00
ha0storage.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ha0storage.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ha_prototypes.h Merge branch '11.4' into 11.7 2025-02-06 16:46:36 +01:00
handler0alter.h
hash0hash.h MDEV-34877 Port "Bug #11745929 Change lock priority so that the transaction holding S-lock gets X-lock first" fix from MySQL to MariaDB 2025-01-23 17:38:32 +03:00
ibuf0ibuf.h MDEV-35000 preparation: Clean up dict_table_t::stat 2025-02-28 08:55:16 +02:00
lock0iter.h
lock0lock.h Merge branch '10.11 into 11.4 2025-01-30 12:01:11 +01:00
lock0lock.inl MDEV-34877 Port "Bug #11745929 Change lock priority so that the transaction holding S-lock gets X-lock first" fix from MySQL to MariaDB 2025-01-23 17:38:32 +03:00
lock0prdt.h MDEV-20612: Partition lock_sys.latch 2021-02-12 17:44:32 +02:00
lock0priv.h MDEV-34877 Port "Bug #11745929 Change lock priority so that the transaction holding S-lock gets X-lock first" fix from MySQL to MariaDB 2025-01-23 17:38:32 +03:00
lock0priv.inl MDEV-34877 Port "Bug #11745929 Change lock priority so that the transaction holding S-lock gets X-lock first" fix from MySQL to MariaDB 2025-01-23 17:38:32 +03:00
lock0types.h MDEV-34877 Port "Bug #11745929 Change lock priority so that the transaction holding S-lock gets X-lock first" fix from MySQL to MariaDB 2025-01-23 17:38:32 +03:00
log0crypt.h Merge 10.11 into 11.0 2024-03-28 10:51:36 +02:00
log0log.h Merge 10.11 into 11.4 2025-03-03 11:07:56 +02:00
log0recv.h Merge 10.11 into 11.4 2025-03-28 13:55:21 +02:00
log0types.h Remove bogus references to replaced Google contributions 2023-08-21 15:51:16 +03:00
mach0data.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
mach0data.inl Merge branch '10.5' into 10.6 2024-08-03 09:04:24 +02:00
mariadb_stats.h MDEV-34190: r_engine_stats.pages_read_count is unrealistically low 2024-07-04 15:24:49 +03:00
mem0mem.h MDEV-35049: btr_search_check_free_space_in_heap() is a bottleneck 2025-01-10 16:30:42 +02:00
mem0mem.inl MDEV-35049: btr_search_check_free_space_in_heap() is a bottleneck 2025-01-10 16:30:42 +02:00
mtr0log.h Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
mtr0mtr.h Merge branch '11.7' into 11.8 2025-02-11 20:29:43 +01:00
mtr0types.h Merge 10.6 into 10.8 2023-02-16 09:17:06 +02:00
os0file.h Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
os0file.inl Merge branch '10.6' into 10.11 2024-10-29 15:24:38 +01:00
page0cur.h MDEV-35312 page_cur_search_with_match() could avoid rec_get_offsets() 2025-01-10 16:40:55 +02:00
page0cur.inl Merge 10.11 into 11.2 2024-08-29 16:02:57 +03:00
page0page.h MDEV-35312 page_cur_search_with_match() could avoid rec_get_offsets() 2025-01-10 16:40:55 +02:00
page0page.inl MDEV-32175: Reduce page_align(), page_offset() calls 2024-11-21 11:01:30 +02:00
page0types.h MDEV-35049: Use CRC-32C and avoid allocating heap 2025-01-10 16:39:44 +02:00
page0zip.h MDEV-29694 Remove the InnoDB change buffer 2023-01-11 17:59:36 +02:00
page0zip.inl MDEV-29694 Remove the InnoDB change buffer 2023-01-11 17:59:36 +02:00
pars0grm.h Cleanup: Remove pars_stored_procedure_call() 2021-07-29 15:37:35 +03:00
pars0opt.h
pars0pars.h MDEV-25919 preparation: Various cleanup 2021-08-31 13:54:20 +03:00
pars0sym.h
pars0types.h
que0que.h MDEV-34515: Reduce context switching in purge 2024-08-26 12:23:17 +03:00
que0que.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
que0types.h
read0types.h MDEV-24402: InnoDB CHECK TABLE ... EXTENDED 2022-10-21 10:02:54 +03:00
rem0cmp.h MDEV-35049: Use CRC-32C and avoid allocating heap 2025-01-10 16:39:44 +02:00
rem0rec.h MDEV-35049: Use CRC-32C and avoid allocating heap 2025-01-10 16:39:44 +02:00
rem0rec.inl MDEV-35049: Use CRC-32C and avoid allocating heap 2025-01-10 16:39:44 +02:00
rem0types.h
row0ext.h Merge branch '10.3' into 10.4 2022-01-30 09:46:52 +01:00
row0ext.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
row0ftsort.h Merge branch '10.5' into 10.6 2023-11-08 15:57:05 +01:00
row0import.h MDEV-26137 Improve import tablespace workflow. 2023-07-04 17:56:27 +10:00
row0ins.h Merge 10.5 into 10.6 2023-03-28 15:25:52 +03:00
row0log.h MDEV-15250 UPSERT during ALTER TABLE results in 'Duplicate entry' error for alter 2022-04-26 16:22:56 +05:30
row0merge.h MDEV-34703 LOAD DATA INFILE using Innodb bulk load aborts 2025-01-15 23:49:13 +05:30
row0mysql.h MDEV-35854: Clarify row_rename_table_for_mysql() 2025-01-23 14:38:35 +02:00
row0purge.h MDEV-34515: Contention between purge and workload 2024-08-26 12:23:06 +03:00
row0quiesce.h
row0row.h Merge 10.11 into 11.4 2025-03-03 11:07:56 +02:00
row0row.inl MDEV-36015: unrepresentable value in row_parse_int() 2025-02-13 15:10:53 +01:00
row0sel.h MDEV-28730 Remove internal parser usage from InnoDB fulltext 2025-05-26 16:35:18 +05:30
row0types.h
row0uins.h
row0umod.h
row0undo.h MDEV-32050: Clean up log parsing 2023-10-25 08:27:08 +03:00
row0upd.h MDEV-28730 Remove internal parser usage from InnoDB fulltext 2025-05-26 16:35:18 +05:30
row0upd.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
row0vers.h MDEV-34515: Contention between purge and workload 2024-08-26 12:23:06 +03:00
rw_lock.h MDEV-34983: Remove x86 asm from InnoDB 2024-09-23 12:51:27 +03:00
small_vector.h MDEV-35701 trx_t::autoinc_locks causes unnecessary dynamic memory allocation 2025-01-15 16:55:01 +02:00
srv0mon.h Merge 10.11 into 11.0 2024-03-28 10:51:36 +02:00
srv0mon.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
srv0srv.h Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
srv0start.h MDEV-19229 Allow innodb_undo_tablespaces to be changed after database creation 2022-10-25 11:19:36 +05:30
srw_lock.h Merge 10.6 into 10.11 2024-10-03 10:55:08 +03:00
sux_lock.h Merge branch '10.11' into 11.4 2025-01-14 23:45:41 +01:00
transactional_lock_guard.h MDEV-34973 fixup for POWER,s390x 2024-10-01 13:29:59 +03:00
trx0i_s.h MDEV-35189: Updating cache for INNODB_LOCKS et al is suboptimal 2024-11-12 12:17:34 +02:00
trx0purge.h Merge branch '10.6' into 10.11 2024-10-29 15:24:38 +01:00
trx0rec.h Merge 10.6 into 10.11 2024-08-29 07:47:29 +03:00
trx0roll.h Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
trx0rseg.h Merge 10.6 into 10.11 2024-10-03 10:55:08 +03:00
trx0sys.h Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
trx0trx.h Merge branch '11.4' into 11.7 2025-02-06 16:46:36 +01:00
trx0trx.inl MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure 2024-12-12 18:02:00 +02:00
trx0types.h Merge 10.6 into 10.11 2024-12-19 15:38:53 +02:00
trx0undo.h Merge 10.11 into 11.4 2024-12-02 11:35:34 +02:00
trx0undo.inl MDEV-33819 The purge of committed history is mis-parsing some log 2024-04-08 11:48:46 +03:00
trx0xa.h
univ.i Merge branch '10.11' into 11.4 2025-01-14 23:45:41 +01:00
ut0byte.h MDEV-21174 fixup: Remove unused ut_bit_set_nth() 2023-09-19 18:02:56 +03:00
ut0byte.inl MDEV-21174 fixup: Remove unused ut_bit_set_nth() 2023-09-19 18:02:56 +03:00
ut0counter.h Merge 10.5 into 10.6 2024-06-17 08:40:07 +03:00
ut0dbg.h
ut0list.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ut0list.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ut0lst.h Do not use C++11 before MariaDB 10.4 2022-10-14 11:54:05 +03:00
ut0mem.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ut0mem.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ut0new.h Merge 10.5 into 10.6 2024-03-27 15:00:56 +02:00
ut0pool.h Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
ut0rbt.h
ut0rnd.h MDEV-35049: Privatize ut_fold_ulint_pair() 2025-01-10 16:40:22 +02:00
ut0sort.h
ut0stage.h
ut0ut.h MDEV-35049: Use CRC-32C and avoid allocating heap 2025-01-10 16:39:44 +02:00
ut0vec.h MDEV-33383: Replace fts_doc_id_cmp, ib_vector_sort 2024-02-12 17:01:17 +02:00
ut0vec.inl MDEV-33383: Replace fts_doc_id_cmp, ib_vector_sort 2024-02-12 17:01:17 +02:00
ut0wqueue.h Merge 10.5 into 10.6 2021-10-21 16:06:34 +03:00