MySQL 9.1.0
Source Code Documentation
|
Full Text Search functionality. More...
#include <sys/types.h>
#include "dict0dd.h"
#include "dict0dict.h"
#include "fts0priv.h"
#include "fts0types.h"
#include "pars0pars.h"
#include "que0que.h"
#include "trx0roll.h"
#include <algorithm>
#include <string>
#include "current_thd.h"
Functions | |
int | fts_get_table_id (const fts_table_t *fts_table, char *table_id) |
Get the table id. More... | |
static char * | fts_get_table_name_prefix_low (const fts_table_t *fts_table, bool is_5_7) |
Construct the prefix name of an FTS table. More... | |
char * | fts_get_table_name_prefix (const fts_table_t *fts_table) |
Construct the prefix name of an FTS table. More... | |
char * | fts_get_table_name_prefix_5_7 (const fts_table_t *fts_table) |
Construct the prefix name of an FTS table in 5.7 compatible name. More... | |
static void | fts_get_table_name_low (const fts_table_t *fts_table, char *table_name, bool is_5_7) |
Construct the name of an ancillary FTS table for the given table. More... | |
void | fts_get_table_name (const fts_table_t *fts_table, char *table_name) |
Construct the name of an ancillary FTS table for the given table. More... | |
void | fts_get_table_name_5_7 (const fts_table_t *fts_table, char *table_name) |
Construct the name of an ancillary FTS table for the given table in 5.7 compatible format. More... | |
que_t * | fts_parse_sql (fts_table_t *fts_table, pars_info_t *info, const char *sql) |
Parse an SQL string. More... | |
dberr_t | fts_eval_sql (trx_t *trx, que_t *graph) |
Evaluate an SQL query graph. More... | |
const char * | fts_get_select_columns_str (dict_index_t *index, pars_info_t *info, mem_heap_t *heap) |
Construct the column specification part of the SQL string for selecting the indexed FTS columns for the given table. More... | |
dberr_t | fts_sql_commit (trx_t *trx) |
Commit a transaction. More... | |
dberr_t | fts_sql_rollback (trx_t *trx) |
Rollback a transaction. More... | |
Variables | |
static const char * | fts_sql_begin = "PROCEDURE P() IS\n" |
SQL statements for creating the ancillary FTS tables. More... | |
static const char * | fts_sql_end |
Postamble to non-committing SQL statements. More... | |
Full Text Search functionality.
Created 2007-03-27 Sunny Bains
Evaluate an SQL query graph.
Evaluate a parsed SQL statement.
trx | in: transaction |
graph | in: Query graph to evaluate |
const char * fts_get_select_columns_str | ( | dict_index_t * | index, |
pars_info_t * | info, | ||
mem_heap_t * | heap | ||
) |
Construct the column specification part of the SQL string for selecting the indexed FTS columns for the given table.
Adds the necessary bound ids to the given 'info' and returns the SQL string. Examples:
One indexed column named "text":
"$sel0", info/ids: sel0 -> "text"
Two indexed columns named "subject" and "content":
"$sel0, $sel1", info/ids: sel0 -> "subject", sel1 -> "content",
index | in: index |
info | in/out: parser info |
heap | in: memory heap |
int fts_get_table_id | ( | const fts_table_t * | fts_table, |
char * | table_id | ||
) |
Get the table id.
fts_table | in: FTS Auxiliary table |
table_id | out: table id, must be at least FTS_AUX_MIN_TABLE_ID_LENGTH bytes long |
void fts_get_table_name | ( | const fts_table_t * | fts_table, |
char * | table_name | ||
) |
Construct the name of an ancillary FTS table for the given table.
Caller must allocate enough memory(usually size of MAX_FULL_NAME_LEN) for param 'table_name'.
fts_table | in: Auxiliary table type |
table_name | in/out: aux table name |
void fts_get_table_name_5_7 | ( | const fts_table_t * | fts_table, |
char * | table_name | ||
) |
Construct the name of an ancillary FTS table for the given table in 5.7 compatible format.
Caller must allocate enough memory(usually size of MAX_FULL_NAME_LEN) for param 'table_name'
[in] | fts_table | Auxiliary table object |
[in,out] | table_name | aux table name |
|
static |
Construct the name of an ancillary FTS table for the given table.
Caller must allocate enough memory(usually size of MAX_FULL_NAME_LEN) for param 'table_name'
[in] | fts_table | FTS Aux table |
[in,out] | table_name | aux table name |
[in] | is_5_7 | true if we need 5.7 compatible name |
char * fts_get_table_name_prefix | ( | const fts_table_t * | fts_table | ) |
Construct the prefix name of an FTS table.
fts_table | in: Auxiliary table type |
char * fts_get_table_name_prefix_5_7 | ( | const fts_table_t * | fts_table | ) |
Construct the prefix name of an FTS table in 5.7 compatible name.
[in] | fts_table | Auxiliary FTS table |
|
static |
Construct the prefix name of an FTS table.
[in] | fts_table | Auxiliary FTS table |
[in] | is_5_7 | true if we need 5.7 compatible name |
que_t * fts_parse_sql | ( | fts_table_t * | fts_table, |
pars_info_t * | info, | ||
const char * | sql | ||
) |
Parse an SQL string.
fts_table | in: FTS auxiliarry table info |
info | in: info struct, or NULL |
sql | in: SQL string to evaluate |
Commit a transaction.
trx | in: transaction |
Rollback a transaction.
trx | in: transaction |
SQL statements for creating the ancillary FTS tables.
Preamble to all SQL statements.
|
static |
Postamble to non-committing SQL statements.