MySQL 8.0.39
Source Code Documentation
|
#include <assert.h>
#include <sys/types.h>
#include "create_field.h"
#include "field.h"
#include "handler.h"
#include "mysql/components/services/clone_protocol_service.h"
#include "row0pread-adapter.h"
#include "row0pread-histogram.h"
#include "trx0trx.h"
Go to the source code of this file.
Classes | |
struct | innodb_idx_translate_t |
struct | INNOBASE_SHARE |
InnoDB table share. More... | |
class | ha_innobase |
The class defining a handle to an InnoDB table. More... | |
struct | new_ft_info |
Structure Returned by ha_innobase::ft_init_ext() More... | |
class | create_table_info_t |
Class for handling create table information. More... | |
class | innobase_basic_ddl |
Class of basic DDL implementation, for CREATE/DROP/RENAME TABLE. More... | |
class | innobase_truncate< Table > |
Class to handle TRUNCATE for one InnoDB table or one partition. More... | |
Namespaces | |
namespace | dd |
The version of the current data dictionary table definitions. | |
namespace | dd::cache |
Typedefs | |
typedef struct new_ft_info | NEW_FT_INFO |
Structure Returned by ha_innobase::ft_init_ext() More... | |
typedef void(* | my_gcolumn_templatecallback_t) (const TABLE *, void *) |
Callback function definition, used by MySQL server layer to initialized the table virtual columns' template. More... | |
Enumerations | |
enum | fts_doc_id_index_enum { FTS_INCORRECT_DOC_ID_INDEX , FTS_EXIST_DOC_ID_INDEX , FTS_NOT_EXIST_DOC_ID_INDEX } |
Some defines for innobase_fts_check_doc_id_index() return value. More... | |
Functions | |
ulong | thd_parallel_read_threads (THD *thd) |
Return the number of read threads for this session. More... | |
void | innobase_register_trx (handlerton *hton, THD *thd, trx_t *trx) |
Allocates an InnoDB transaction for a MySQL handler object for DML. More... | |
trx_t * | innobase_trx_allocate (THD *thd) |
Allocates an InnoDB transaction for a MySQL handler object. More... | |
trx_t::isolation_level_t | innobase_trx_map_isolation_level (enum_tx_isolation iso) |
Maps a MySQL trx isolation level code to the InnoDB isolation level code. More... | |
bool | innobase_match_index_columns (const KEY *key_info, const dict_index_t *index_info) |
Match index columns between MySQL and InnoDB. More... | |
bool | innobase_index_name_is_reserved (THD *thd, const KEY *key_info, ulint num_of_keys) |
This function checks each index name for a table against reserved system default primary index name 'GEN_CLUST_INDEX'. More... | |
static bool | tablespace_is_file_per_table (const HA_CREATE_INFO *create_info) |
Check if the explicit tablespace targeted is file_per_table. More... | |
static bool | tablespace_is_shared_space (const HA_CREATE_INFO *create_info) |
Check if table will be explicitly put in an existing shared general or system tablespace. More... | |
static bool | tablespace_is_general_space (const HA_CREATE_INFO *create_info) |
Check if table will be explicitly put in a general tablespace. More... | |
static bool | is_shared_tablespace (const char *tablespace_name) |
Check if tablespace is shared tablespace. More... | |
static int | validate_autoextend_size_value (uint64_t ext_size) |
Validate AUTOEXTEND_SIZE attribute for a tablespace. More... | |
void | innobase_parse_hint_from_comment (THD *thd, dict_table_t *table, const TABLE_SHARE *table_share) |
Parse hint for table and its indexes, and update the information in dictionary. More... | |
trx_t *& | thd_to_trx (THD *thd) |
Obtain the InnoDB transaction of a MySQL thread. More... | |
bool | innobase_fts_load_stopword (dict_table_t *table, trx_t *trx, THD *thd) |
Initialize the table FTS stopword list. More... | |
fts_doc_id_index_enum | innobase_fts_check_doc_id_index (const dict_table_t *table, const TABLE *altered_table, ulint *fts_doc_col_no) |
Check whether the table has a unique index with FTS_DOC_ID_INDEX_NAME on the Doc ID column. More... | |
fts_doc_id_index_enum | innobase_fts_check_doc_id_index_in_def (ulint n_key, const KEY *key_info) |
Check whether the table has a unique index with FTS_DOC_ID_INDEX_NAME on the Doc ID column in MySQL create index definition. More... | |
void | innobase_copy_frm_flags_from_table_share (dict_table_t *innodb_table, const TABLE_SHARE *table_share) |
Copy table flags from MySQL's TABLE_SHARE into an InnoDB table object. More... | |
void | innodb_base_col_setup (dict_table_t *table, const Field *field, dict_v_col_t *v_col) |
Set up base columns for virtual column. More... | |
void | innodb_base_col_setup_for_stored (const dict_table_t *table, const Field *field, dict_s_col_t *s_col) |
Set up base columns for stored column. More... | |
static bool | innobase_is_s_fld (const Field *field) |
whether this is a stored column More... | |
static bool | innobase_is_multi_value_fld (const Field *field) |
Whether this is a computed multi-value virtual column. More... | |
static bool | normalize_table_name (char *norm_name, const char *name) |
bool | trx_is_registered_for_2pc (const trx_t *trx) |
Note that a transaction has been registered with MySQL. More... | |
int | convert_error_code_to_mysql (dberr_t error, uint32_t flags, THD *thd) |
Converts an InnoDB error code to a MySQL error code. More... | |
page_cur_mode_t | convert_search_mode_to_innobase (enum ha_rkey_function find_flag) |
Converts a search mode flag understood by MySQL to a flag understood by InnoDB. More... | |
rec_per_key_t | innodb_rec_per_key (const dict_index_t *index, ulint i, ha_rows records) |
Calculate Record Per Key value. More... | |
void | innobase_build_v_templ (const TABLE *table, const dict_table_t *ib_table, dict_vcol_templ_t *s_templ, const dict_add_v_col_t *add_v, bool locked, const char *share_tbl_name) |
Build template for the virtual columns and their base columns. More... | |
void | innobase_build_v_templ_callback (const TABLE *table, void *ib_table) |
Callback used by MySQL server layer to initialize the table virtual columns' template. More... | |
void | innobase_discard_table (THD *thd, dict_table_t *table) |
Drop the statistics for a specified table, and mark it as discard after DDL. More... | |
Variables | |
const char | innobase_index_reserve_name [] |
"GEN_CLUST_INDEX" is the name reserved for InnoDB default system clustered index when there is no primary key. More... | |
const mysql_service_clone_protocol_t * | clone_protocol_svc |
Clone protocol service. More... | |
const struct _ft_vft | ft_vft_result |
constexpr uint32_t | SIZE_MB = 1024 * 1024 |
bool | innobase_stats_on_metadata |
typedef void(* my_gcolumn_templatecallback_t) (const TABLE *, void *) |
Callback function definition, used by MySQL server layer to initialized the table virtual columns' template.
typedef struct new_ft_info NEW_FT_INFO |
Structure Returned by ha_innobase::ft_init_ext()
Converts an InnoDB error code to a MySQL error code.
Also tells to MySQL about a possible transaction rollback inside InnoDB caused by a lock wait timeout or a deadlock.
[in] | error | InnoDB error code. |
[in] | flags | InnoDB table flags or 0. |
[in] | thd | MySQL thread or NULL. |
page_cur_mode_t convert_search_mode_to_innobase | ( | enum ha_rkey_function | find_flag | ) |
Converts a search mode flag understood by MySQL to a flag understood by InnoDB.
[in] | find_flag | MySQL search mode flag. |
void innobase_build_v_templ | ( | const TABLE * | table, |
const dict_table_t * | ib_table, | ||
dict_vcol_templ_t * | s_templ, | ||
const dict_add_v_col_t * | add_v, | ||
bool | locked, | ||
const char * | share_tbl_name | ||
) |
Build template for the virtual columns and their base columns.
This is done when the table first opened.
[in] | table | MySQL TABLE |
[in] | ib_table | InnoDB dict_table_t |
[in,out] | s_templ | InnoDB template structure |
[in] | add_v | new virtual columns added along with add index call |
[in] | locked | true if dict_sys mutex is held |
[in] | share_tbl_name | original MySQL table name |
void innobase_build_v_templ_callback | ( | const TABLE * | table, |
void * | ib_table | ||
) |
Callback used by MySQL server layer to initialize the table virtual columns' template.
[in] | table | MySQL TABLE |
[in,out] | ib_table | InnoDB table |
void innobase_copy_frm_flags_from_table_share | ( | dict_table_t * | innodb_table, |
const TABLE_SHARE * | table_share | ||
) |
Copy table flags from MySQL's TABLE_SHARE into an InnoDB table object.
Those flags are stored in .frm file and end up in the MySQL table object, but are frequently used inside InnoDB so we keep their copies into the InnoDB table object. in: table share
Those flags are stored in .frm file and end up in the MySQL table object, but are frequently used inside InnoDB so we keep their copies into the InnoDB table object.
innodb_table | in/out: InnoDB table |
table_share | in: table share |
void innobase_discard_table | ( | THD * | thd, |
dict_table_t * | table | ||
) |
Drop the statistics for a specified table, and mark it as discard after DDL.
[in,out] | thd | THD object |
[in,out] | table | InnoDB table object |
fts_doc_id_index_enum innobase_fts_check_doc_id_index | ( | const dict_table_t * | table, |
const TABLE * | altered_table, | ||
ulint * | fts_doc_col_no | ||
) |
Check whether the table has a unique index with FTS_DOC_ID_INDEX_NAME on the Doc ID column.
table | in: table definition |
altered_table | in: MySQL table that is being altered |
fts_doc_col_no | out: The column number for Doc ID, or ULINT_UNDEFINED if it is being created in ha_alter_info |
fts_doc_id_index_enum innobase_fts_check_doc_id_index_in_def | ( | ulint | n_key, |
const KEY * | key_info | ||
) |
Check whether the table has a unique index with FTS_DOC_ID_INDEX_NAME on the Doc ID column in MySQL create index definition.
n_key | in: Number of keys |
key_info | in: Key definition |
bool innobase_fts_load_stopword | ( | dict_table_t * | table, |
trx_t * | trx, | ||
THD * | thd | ||
) |
Initialize the table FTS stopword list.
table | in: Table has the FTS |
trx | in: transaction |
thd | in: current thread |
This function checks each index name for a table against reserved system default primary index name 'GEN_CLUST_INDEX'.
If a name matches, this function pushes an warning message to the client, and returns true.
If a name matches, this function pushes an warning message to the client, and returns true.
thd | in/out: MySQL connection |
key_info | in: Indexes to be created |
num_of_keys | in: Number of indexes to be created. |
|
inlinestatic |
Whether this is a computed multi-value virtual column.
This condition check should be equal to the following one: (innobase_is_v_fld(field) && (field)->gcol_info->expr_item && field->gcol_info->expr_item->returns_array())
|
inlinestatic |
whether this is a stored column
bool innobase_match_index_columns | ( | const KEY * | key_info, |
const dict_index_t * | index_info | ||
) |
Match index columns between MySQL and InnoDB.
This function checks whether the index column information is consistent between KEY info from mysql and that from innodb index.
[in] | key_info | Index info from mysql |
[in] | index_info | Index info from InnoDB |
void innobase_parse_hint_from_comment | ( | THD * | thd, |
dict_table_t * | table, | ||
const TABLE_SHARE * | table_share | ||
) |
Parse hint for table and its indexes, and update the information in dictionary.
[in] | thd | Connection thread |
[in,out] | table | Target table |
[in] | table_share | Table definition |
void innobase_register_trx | ( | handlerton * | hton, |
THD * | thd, | ||
trx_t * | trx | ||
) |
Allocates an InnoDB transaction for a MySQL handler object for DML.
[in] | hton | Innobase handlerton. |
[in] | thd | MySQL thd (connection) object. |
[in] | trx | transaction to register. |
Allocates an InnoDB transaction for a MySQL handler object for DML.
This MUST be called for every transaction for which the user may call commit or rollback. Calling this several times to register the same transaction is allowed, too. This function also registers the current SQL statement.
Allocates an InnoDB transaction for a MySQL handler object.
Allocates an InnoDB transaction for a MySQL handler object.
thd | in: user thread handle |
trx_t::isolation_level_t innobase_trx_map_isolation_level | ( | enum_tx_isolation | iso | ) |
Maps a MySQL trx isolation level code to the InnoDB isolation level code.
[in] | iso | MySQL isolation level code |
void innodb_base_col_setup | ( | dict_table_t * | table, |
const Field * | field, | ||
dict_v_col_t * | v_col | ||
) |
Set up base columns for virtual column.
[in] | table | the InnoDB table |
[in] | field | MySQL field |
[in,out] | v_col | virtual column to be set up |
void innodb_base_col_setup_for_stored | ( | const dict_table_t * | table, |
const Field * | field, | ||
dict_s_col_t * | s_col | ||
) |
Set up base columns for stored column.
[in] | table | InnoDB table |
[in] | field | MySQL field |
[in,out] | s_col | stored column |
rec_per_key_t innodb_rec_per_key | ( | const dict_index_t * | index, |
ulint | i, | ||
ha_rows | records | ||
) |
Calculate Record Per Key value.
Need to exclude the NULL value if innodb_stats_method is set to "nulls_ignored"
[in] | index | InnoDB index. |
[in] | i | The column we are calculating rec per key. |
[in] | records | Estimated total records. |
|
inlinestatic |
Check if tablespace is shared tablespace.
[in] | tablespace_name | Name of the tablespace |
|
inlinestatic |
|
inlinestatic |
Check if the explicit tablespace targeted is file_per_table.
[in] | create_info | Metadata for the table to create. |
|
inlinestatic |
Check if table will be explicitly put in a general tablespace.
[in] | create_info | Metadata for the table to create. |
|
inlinestatic |
Check if table will be explicitly put in an existing shared general or system tablespace.
[in] | create_info | Metadata for the table to create. |
ulong thd_parallel_read_threads | ( | THD * | thd | ) |
Return the number of read threads for this session.
[in] | thd | Session instance, or nullptr to query the global innodb_parallel_read_threads value. |
Obtain the InnoDB transaction of a MySQL thread.
[in,out] | thd | MySQL thread handler. |
|
inline |
Note that a transaction has been registered with MySQL.
[in] | trx | Transaction. |
|
inlinestatic |
Validate AUTOEXTEND_SIZE attribute for a tablespace.
[in] | ext_size | Value of autoextend_size attribute |
|
extern |
Clone protocol service.
|
extern |
|
extern |
"GEN_CLUST_INDEX" is the name reserved for InnoDB default system clustered index when there is no primary key.
|
extern |
|
constexpr |