MySQL  8.0.18
Source Code Documentation
ha_innodb.cc File Reference
#include "my_config.h"
#include <auto_thd.h>
#include <errno.h>
#include <fcntl.h>
#include <gstream.h>
#include <limits.h>
#include <log.h>
#include <math.h>
#include <stdlib.h>
#include <strfunc.h>
#include <time.h>
#include <sql_table.h>
#include "mysql/components/services/system_variable_source.h"
#include <current_thd.h>
#include <debug_sync.h>
#include <derror.h>
#include <my_bitmap.h>
#include <my_check_opt.h>
#include <mysql/service_thd_alloc.h>
#include <mysql/service_thd_wait.h>
#include <mysql_com.h>
#include <mysqld.h>
#include <sql_acl.h>
#include <sql_class.h>
#include <sql_show.h>
#include <sql_tablespace.h>
#include <sql_thd_internal_api.h>
#include "api0api.h"
#include "api0misc.h"
#include "arch0arch.h"
#include "arch0page.h"
#include "auth_acls.h"
#include "btr0btr.h"
#include "btr0bulk.h"
#include "btr0cur.h"
#include "btr0sea.h"
#include "buf0dblwr.h"
#include "buf0dump.h"
#include "buf0flu.h"
#include "buf0lru.h"
#include "buf0stats.h"
#include "clone0api.h"
#include "clone0clone.h"
#include "dd/dd.h"
#include "dd/dictionary.h"
#include "dd/properties.h"
#include "dd/types/index.h"
#include "dd/types/object_table.h"
#include "dd/types/object_table_definition.h"
#include "dd/types/partition.h"
#include "dd/types/table.h"
#include "dd/types/tablespace.h"
#include "dict0boot.h"
#include "dict0crea.h"
#include "dict0dd.h"
#include "dict0dict.h"
#include "dict0load.h"
#include "dict0stats.h"
#include "dict0stats_bg.h"
#include "fil0fil.h"
#include "fsp0fsp.h"
#include "fsp0space.h"
#include "fsp0sysspace.h"
#include "fts0fts.h"
#include "fts0plugin.h"
#include "fts0priv.h"
#include "fts0types.h"
#include "ha_innodb.h"
#include "ha_innopart.h"
#include "ha_prototypes.h"
#include "i_s.h"
#include "ibuf0ibuf.h"
#include "lex_string.h"
#include "lob0lob.h"
#include "lock0lock.h"
#include "log0meb.h"
#include "mem0mem.h"
#include "mtr0mtr.h"
#include "my_compare.h"
#include "my_dbug.h"
#include "my_double2ulonglong.h"
#include "my_io.h"
#include "my_macros.h"
#include "my_psi_config.h"
#include "mysql/components/services/log_builtins.h"
#include "mysql/plugin.h"
#include "mysql/psi/mysql_data_lock.h"
#include "mysys_err.h"
#include "os0thread-create.h"
#include "os0thread.h"
#include "p_s.h"
#include "page0zip.h"
#include "pars0pars.h"
#include "rem0types.h"
#include "row0ext.h"
#include "row0import.h"
#include "row0ins.h"
#include "row0merge.h"
#include "row0mysql.h"
#include "row0quiesce.h"
#include "row0sel.h"
#include "row0upd.h"
#include "sql/plugin_table.h"
#include "srv0mon.h"
#include "srv0srv.h"
#include "srv0start.h"
#include "sync0sync.h"
#include "trx0purge.h"
#include "dict0priv.h"
#include "dict0sdi.h"
#include "dict0upgrade.h"
#include "sql/item.h"
#include "sql/json_dom.h"
#include "sql_base.h"
#include "srv0tmp.h"
#include "trx0rec.h"
#include "trx0roll.h"
#include "trx0rseg.h"
#include "trx0sys.h"
#include "trx0trx.h"
#include "trx0xa.h"
#include "ut0mem.h"
#include "json_binary.h"
#include "log0log.h"
#include "os0file.h"
#include <mutex>
#include <string>
#include <vector>

Classes

class  Validate_files
 Validate the DD tablespace data against what's read during the directory scan on startup. More...
 
struct  table_list_item
 Table list item structure is used to store only the table and name. More...
 
struct  tablename_compare
 Structure to compare two st_tablename objects using their db and tablename. More...
 
struct  ShowStatus
 Callback for collecting mutex statistics. More...
 
struct  ShowStatus::Value
 For tracking the mutex metrics. More...
 
struct  ShowStatus::OrderByWaits
 Order by m_waits, in descending order. More...
 
struct  ShowStatus::GetCount
 Collect the individual latch counts. More...
 

Macros

#define EQ_CURRENT_THD(thd)   ((thd) == current_thd)
 
#define get_sys_mem   get_mem_sysconf
 
#define INNOBASE_WAKE_INTERVAL   32
 
#define PSI_KEY(n, flag, volatility, doc)   { &(n##_key.m_value), #n, flag, volatility, doc }
 
#define PSI_MUTEX_KEY(n, flag, volatility, doc)   { &(n##_key.m_value), #n, flag, volatility, doc }
 
#define PSI_RWLOCK_KEY(n, volatility, doc)   { &n##_key.m_value, #n, PSI_FLAG_RWLOCK_SX, volatility, doc }
 
#define INNODB_API_CB_ARRAY_ELEMENT_TRANSFORM(stem)   (ib_cb_t) ib_##stem,
 Set up InnoDB API callback function array. More...
 
#define true_word_char(c, ch)   ((c) & (_MY_U | _MY_L | _MY_NMR) || (ch) == '_')
 
#define misc_word_char(X)   0
 
#define NAME_CHAR_LEN_PARTITIONS_STR   "199"
 Maximum length of a table name from InnoDB point of view, including partitions and subpartitions, in number of characters. More...
 
#define innodb_srv_buf_dump_filename_validate   NULL
 

Enumerations

enum  default_row_format_enum { DEFAULT_ROW_FORMAT_REDUNDANT = 0, DEFAULT_ROW_FORMAT_COMPACT = 1, DEFAULT_ROW_FORMAT_DYNAMIC = 2 }
 Note we cannot use rec_format_enum because we do not allow COMPRESSED row format for innodb_default_row_format option. More...
 

Functions

static double get_mem_sysconf ()
 
static void release_sysvar_source_service ()
 
static void acquire_sysvar_source_service ()
 
static rec_format_t get_row_format (ulong row_format)
 Return the InnoDB ROW_FORMAT enum value. More...
 
static float innobase_fts_retrieve_ranking (FT_INFO *fts_hdl)
 Retrieve the FTS Relevance Ranking result for doc with doc_id of m_prebuilt->fts_doc_id. More...
 
static void innobase_fts_close_ranking (FT_INFO *fts_hdl)
 Free the memory for the FTS handler. More...
 
void srv_debug_loop (void)
 Function used to loop a thread (for debugging/instrumentation purpose). More...
 
static float innobase_fts_find_ranking (FT_INFO *fts_hdl, uchar *, uint)
 Find and Retrieve the FTS Relevance Ranking result for doc with doc_id of m_prebuilt->fts_doc_id. More...
 
static uint innobase_fts_get_version ()
 
static ulonglong innobase_fts_flags ()
 
static ulonglong innobase_fts_retrieve_docid (FT_INFO_EXT *fts_hdl)
 Find and Retrieve the FTS doc_id for the current result row. More...
 
static ulonglong innobase_fts_count_matches (FT_INFO_EXT *fts_hdl)
 Find and retrieve the size of the current result. More...
 
static int innodb_stopword_table_validate (THD *thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
 Check whether valid argument given to innodb_ft_*_stopword_table. More...
 
static int innodb_tmpdir_validate (THD *thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
 Validate passed-in "value" is a valid directory name. More...
 
static ulint innobase_map_isolation_level (enum_tx_isolation iso)
 Maps a MySQL trx isolation level code to the InnoDB isolation level code. More...
 
static uint get_field_offset (const TABLE *table, const Field *field)
 Gets field offset for a field in a table. More...
 
static MYSQL_THDVAR_BOOL (table_locks, PLUGIN_VAR_OPCMDARG, "Enable InnoDB locking in LOCK TABLES", NULL, NULL, TRUE)
 
static MYSQL_THDVAR_BOOL (strict_mode, PLUGIN_VAR_OPCMDARG, "Use strict mode when evaluating create options.", NULL, NULL, TRUE)
 
static MYSQL_THDVAR_BOOL (ft_enable_stopword, PLUGIN_VAR_OPCMDARG, "Create FTS index with stopword.", NULL, NULL, TRUE)
 
static MYSQL_THDVAR_ULONG (lock_wait_timeout, PLUGIN_VAR_RQCMDARG, "Timeout in seconds an InnoDB transaction may wait " "for a lock before being rolled back. Values above " "100000000 disable the timeout.", NULL, NULL, 50, 1, 1024 *1024 *1024, 0)
 
static MYSQL_THDVAR_STR (ft_user_stopword_table, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_MEMALLOC, "User supplied stopword table name, effective in the session level.", innodb_stopword_table_validate, NULL, NULL)
 
static MYSQL_THDVAR_STR (tmpdir, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_MEMALLOC, "Directory for temporary non-tablespace files.", innodb_tmpdir_validate, NULL, NULL)
 
static MYSQL_THDVAR_ULONG (parallel_read_threads, PLUGIN_VAR_RQCMDARG, "Number of threads to do parallel read.", NULL, NULL, 4, 1, Parallel_reader::MAX_THREADS, 0)
 
static INNOBASE_SHAREget_share (const char *table_name)
 Handling the shared INNOBASE_SHARE structure that is needed to provide table locking. More...
 
static void free_share (INNOBASE_SHARE *share)
 Free the shared object that was registered with get_share(). More...
 
static int innobase_close_connection (handlerton *hton, THD *thd)
 Frees a possible InnoDB trx object associated with the current THD. More...
 
static void innobase_kill_connection (handlerton *hton, THD *thd)
 Cancel any pending lock request associated with the current THD. More...
 
static int innobase_commit (handlerton *hton, THD *thd, bool commit_trx)
 Commits a transaction in an InnoDB database or marks an SQL statement ended. More...
 
static int innobase_rollback (handlerton *hton, THD *thd, bool rollback_trx)
 Rolls back a transaction to a savepoint. More...
 
static int innobase_rollback_to_savepoint (handlerton *hton, THD *thd, void *savepoint)
 Rolls back a transaction to a savepoint. More...
 
static bool innobase_rollback_to_savepoint_can_release_mdl (handlerton *hton, THD *thd)
 Check whether innodb state allows to safely release MDL locks after rollback to savepoint. More...
 
static int innobase_savepoint (handlerton *hton, THD *thd, void *savepoint)
 Sets a transaction savepoint. More...
 
static int innobase_release_savepoint (handlerton *hton, THD *thd, void *savepoint)
 Release transaction savepoint name. More...
 
static handlerinnobase_create_handler (handlerton *hton, TABLE_SHARE *table, bool partitioned, MEM_ROOT *mem_root)
 Function for constructing an InnoDB table handler instance. More...
 
static bool innobase_get_table_statistics (const char *db_name, const char *table_name, dd::Object_id se_private_id, const dd::Properties &ts_se_private_data, const dd::Properties &tbl_se_private_data, uint stat_flags, ha_statistics *stats)
 Retrieve table satistics. More...
 
static bool innobase_get_index_column_cardinality (const char *db_name, const char *table_name, const char *index_name, uint index_ordinal_position, uint column_ordinal_position, dd::Object_id se_private_id, ulonglong *cardinality)
 Retrieve index column cardinality. More...
 
static bool innobase_get_tablespace_statistics (const char *tablespace_name, const char *file_name, const dd::Properties &ts_se_private_data, ha_tablespace_statistics *stats)
 Retrieve ha_tablespace_statistics for the tablespace. More...
 
static bool innobase_get_tablespace_type (const dd::Tablespace &space, Tablespace_type *space_type)
 Retrieve the tablespace type. More...
 
static bool innobase_get_tablespace_type_by_name (const char *tablespace_name, Tablespace_type *space_type)
 Retrieve the tablespace type by name. More...
 
static void innobase_post_ddl (THD *thd)
 Perform post-commit/rollback cleanup after DDL statement. More...
 
static bool innodb_check_fk_column_compat (const Ha_fk_column_type *child_column_type, const Ha_fk_column_type *parent_column_type, bool check_charsets)
 Check if types of child and parent columns in foreign key are compatible. More...
 
static void innobase_commit_concurrency_init_default ()
 Initialize the default value of innodb_commit_concurrency. More...
 
static int innobase_xa_prepare (handlerton *hton, THD *thd, bool all)
 This function is used to prepare an X/Open XA distributed transaction. More...
 
static int innobase_xa_recover (handlerton *hton, XA_recover_txn *txn_list, uint len, MEM_ROOT *mem_root)
 This function is used to recover X/Open XA distributed transactions. More...
 
static xa_status_code innobase_commit_by_xid (handlerton *hton, XID *xid)
 This function is used to commit one X/Open XA distributed transaction which is in the prepared state. More...
 
static xa_status_code innobase_rollback_by_xid (handlerton *hton, XID *xid)
 This function is used to rollback one X/Open XA distributed transaction which is in the prepared state. More...
 
static bool innobase_check_reserved_file_name (handlerton *hton, const char *name)
 Checks if the filename name is reserved in InnoDB. More...
 
static bool innobase_is_valid_tablespace_name (ts_command_type ts_cmd, const char *name)
 Check tablespace name validity. More...
 
static int innobase_alter_tablespace (handlerton *hton, THD *thd, st_alter_tablespace *alter_info, const dd::Tablespace *old_ts_def, dd::Tablespace *new_ts_def)
 This API handles CREATE, ALTER & DROP commands for InnoDB tablespaces. More...
 
static const char * innobase_get_tablespace_filename_ext ()
 Get tablespace datafile name extension. More...
 
static void innodb_space_shutdown ()
 Free tablespace resources. More...
 
static int innodb_shutdown (handlerton *, ha_panic_function)
 Shut down InnoDB after the Global Data Dictionary has been shut down. More...
 
static void innodb_pre_dd_shutdown (handlerton *)
 Shut down all InnoDB background tasks that may access the Global Data Dictionary, before the Global Data Dictionary and the rest of InnoDB have been shut down. More...
 
static int innobase_start_trx_and_assign_read_view (handlerton *hton, THD *thd)
 Creates an InnoDB transaction struct for the thd if it does not yet have one. More...
 
static bool innobase_flush_logs (handlerton *hton, bool binlog_group_flush)
 Flush InnoDB redo logs to the file system. More...
 
static int innodb_show_status (handlerton *hton, THD *thd, stat_print_fn *stat_print)
 Implements the SHOW ENGINE INNODB STATUS command. More...
 
static bool innobase_lock_hton_log (handlerton *hton)
 Implements Log_resource lock. More...
 
static bool innobase_unlock_hton_log (handlerton *hton)
 Implements Log_resource unlock. More...
 
static bool innobase_collect_hton_log_info (handlerton *hton, Json_dom *json)
 Implements Log_resource collect_info. More...
 
static bool innobase_show_status (handlerton *hton, THD *thd, stat_print_fn *stat_print, enum ha_stat_type stat_type)
 Return 0 on success and non-zero on failure. More...
 
static void innodb_enable_monitor_at_startup (char *str)
 Parse and enable InnoDB monitor counters during server startup. More...
 
static int innobase_fill_i_s_table (handlerton *, THD *thd, TABLE_LIST *tables, Item *, enum_schema_tables idx)
 Fill handlerton based INFORMATION_SCHEMA tables. More...
 
static void innobase_fts_store_docid (TABLE *tbl, ulonglong doc_id)
 Store doc_id value into FTS_DOC_ID field. More...
 
static int innobase_commit_concurrency_validate (THD *thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
 Check for a valid value of innobase_commit_concurrency. More...
 
ibool thd_is_replication_slave_thread (THD *thd)
 Returns true if the thread is the replication thread on the slave server. More...
 
enum durability_properties thd_requested_durability (const THD *thd)
 Gets information on the durability property requested by thread. More...
 
bool thd_trx_is_read_only (THD *thd)
 Returns true if transaction should be flagged as read-only. More...
 
THDthd_trx_arbitrate (THD *requestor, THD *holder)
 
Check if the transaction can be rolled back More...
 
int thd_trx_priority (THD *thd)
 
More...
 
ibool thd_trx_is_auto_commit (THD *thd)
 Check if the transaction is an auto-commit transaction. More...
 
time_t thd_start_time (const THD *thd)
 
ulint thd_start_time_in_secs (THD *thd)
 Get the thread start time. More...
 
static void innobase_srv_conc_enter_innodb (row_prebuilt_t *prebuilt)
 Enter InnoDB engine after checking the max number of user threads allowed, else the thread is put into sleep. More...
 
static void innobase_srv_conc_exit_innodb (row_prebuilt_t *prebuilt)
 Note that the thread wants to leave InnoDB only if it doesn't have any spare tickets. More...
 
static void innobase_srv_conc_force_exit_innodb (trx_t *trx)
 Force a thread to leave InnoDB even if it has spare tickets. More...
 
const char * server_get_hostname ()
 Returns the NUL terminated value of glob_hostname. More...
 
ibool thd_has_edited_nontrans_tables (THD *thd)
 Returns true if the transaction this thread is processing has edited non-transactional tables. More...
 
ibool thd_is_select (const THD *thd)
 Returns true if the thread is executing a SELECT statement. More...
 
bool innobase_should_madvise_buf_pool ()
 Checks sys_vars and determines if allocator should mark large memory segments with MADV_DONTDUMP. More...
 
void innobase_disable_core_dump ()
 Make sure that core file will not be generated, as generating a core file might violate our promise to not dump buffer pool data, and/or might dump not the expected memory pages due to failure in using madvise. More...
 
ulong thd_lock_wait_timeout (THD *thd)
 Returns the lock wait timeout for the current connection. More...
 
void thd_set_lock_wait_time (THD *thd, ulint value)
 Set the time waited for the lock for the current query. More...
 
const char * thd_innodb_tmpdir (THD *thd)
 Get the value of innodb_tmpdir. More...
 
innodb_session_t *& thd_to_innodb_session (THD *thd)
 Obtain the private handler of InnoDB session specific data. More...
 
trx_t *& thd_to_trx (THD *thd)
 Obtain the InnoDB transaction of a MySQL thread. More...
 
ulong thd_parallel_read_threads (THD *thd)
 Return the number of read threads for this session. More...
 
static bool thd_is_ins_sel_stmt (THD *user_thd)
 Check if statement is of type INSERT .... More...
 
static void add_table_to_thread_cache (dict_table_t *table, mem_heap_t *heap, THD *thd)
 Add the table handler to thread cache. More...
 
void innobase_active_small (void)
 Increments innobase_active_counter and every INNOBASE_WAKE_INTERVALth time calls srv_active_wake_master_thread. 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 and also tells to MySQL about a possible transaction rollback inside InnoDB caused by a lock wait timeout or a deadlock. More...
 
void innobase_mysql_print_thd (FILE *f, THD *thd, uint max_query_len)
 Prints info of a THD object (== user session thread) to the given file. More...
 
const char * innobase_get_err_msg (int error_code)
 Get the error message format string. More...
 
void innobase_get_cset_width (ulint cset, ulint *mbminlen, ulint *mbmaxlen)
 Get the variable length bounds of the given character set. More...
 
void innobase_convert_from_table_id (const CHARSET_INFO *cs, char *to, const char *from, ulint len)
 Converts an identifier to a table name. More...
 
bool innobase_check_identifier_length (const char *id)
 
void innobase_convert_from_id (const CHARSET_INFO *cs, char *to, const char *from, ulint len)
 Converts an identifier to UTF-8. More...
 
int innobase_strcasecmp (const char *a, const char *b)
 Compares NUL-terminated UTF-8 strings case insensitively. More...
 
static int innobase_wildcasecmp (const char *a, const char *b)
 Compares NUL-terminated UTF-8 strings case insensitively. More...
 
const char * innobase_basename (const char *path_name)
 Strip dir name from a full path name and return only the file name. More...
 
void innobase_casedn_str (char *a)
 Makes all characters in a NUL-terminated UTF-8 string lower case. More...
 
void innobase_casedn_path (char *a)
 Makes all characters in a NUL-terminated UTF-8 path string lower case. More...
 
const CHARSET_INFOinnobase_get_charset (THD *mysql_thd)
 Determines the connection character set. More...
 
const char * innobase_get_stmt_unsafe (THD *thd, size_t *length)
 Determines the current SQL statement. More...
 
size_t innobase_get_stmt_safe (THD *thd, char *buf, size_t buflen)
 Determines the current SQL statement. More...
 
ulint innobase_get_table_cache_size (void)
 Get the current setting of the table_def_size global parameter. More...
 
ulint innobase_get_lower_case_table_names (void)
 Get the current setting of the lower_case_table_names global parameter from mysqld.cc. More...
 
char * innobase_mysql_tmpdir ()
 return any of the tmpdir path More...
 
int innobase_mysql_tmpfile (const char *path)
 Creates a temporary file in the location specified by the parameter path. More...
 
static ulint innobase_convert_string (void *to, ulint to_length, CHARSET_INFO *to_cs, const void *from, ulint from_length, CHARSET_INFO *from_cs, uint *errors)
 Wrapper around MySQL's copy_and_convert function. More...
 
ulint innobase_raw_format (const char *data, ulint data_len, ulint charset_coll, char *buf, ulint buf_size)
 Formats the raw data in "data" (in InnoDB on-disk format) that is of type DATA_(CHAR|VARCHAR|MYSQL|VARMYSQL) using "charset_coll" and writes the result to "buf". More...
 
ulonglong innobase_next_autoinc (ulonglong current, ulonglong need, ulonglong step, ulonglong offset, ulonglong max_value)
 Compute the next autoinc value. More...
 
static void innobase_trx_init (THD *thd, trx_t *trx)
 Initializes some fields in an InnoDB transaction object. More...
 
trx_tinnobase_trx_allocate (THD *thd)
 Allocates an InnoDB transaction for a MySQL handler object for DML. More...
 
trx_tcheck_trx_exists (THD *thd)
 Gets the InnoDB transaction handle for a MySQL handler object, creates an InnoDB transaction struct if the corresponding MySQL thread struct still lacks one. More...
 
static void innodb_replace_trx_in_thd (THD *thd, void *new_trx_arg, void **ptr_trx_arg)
 InnoDB transaction object that is currently associated with THD is replaced with that of the 2nd argument. More...
 
static void trx_register_for_2pc (trx_t *trx)
 Note that a transaction has been registered with MySQL 2PC coordinator. More...
 
static void trx_deregister_from_2pc (trx_t *trx)
 Note that a transaction has been deregistered. More...
 
static void innobase_copy_frm_flags_from_create_info (dict_table_t *innodb_table, const HA_CREATE_INFO *create_info)
 Copy table flags from MySQL's HA_CREATE_INFO into an InnoDB table object. 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 innobase_register_trx (handlerton *hton, THD *thd, trx_t *trx)
 Registers an InnoDB transaction with the MySQL 2PC coordinator, so that the MySQL XA code knows to call the InnoDB prepare and commit, or rollback for the transaction. More...
 
void innobase_quote_identifier (FILE *file, trx_t *trx, const char *id)
 Quote a standard SQL identifier like tablespace, index or column name. More...
 
static char * innobase_convert_identifier (char *buf, ulint buflen, const char *id, ulint idlen, THD *thd)
 Convert a table name to the MySQL system_charset_info (UTF-8) and quote it. More...
 
char * innobase_convert_name (char *buf, ulint buflen, const char *id, ulint idlen, THD *thd)
 Convert a table name to the MySQL system_charset_info (UTF-8). More...
 
void innobase_format_name (char *buf, ulint buflen, const char *name)
 A wrapper function of innobase_convert_name(), convert a table name to the MySQL system_charset_info (UTF-8) and quote it if needed. More...
 
ibool trx_is_interrupted (const trx_t *trx)
 Determines if the currently running transaction has been interrupted. More...
 
ibool trx_is_strict (trx_t *trx)
 Determines if the currently running transaction is in strict mode. More...
 
static int innodb_init_abort ()
 Free any resources that were allocated and return failure. More...
 
static int innobase_init_files (dict_init_mode_t dict_init_mode, List< const Plugin_tablespace > *tablespaces)
 Open or create InnoDB data files. More...
 
static bool innobase_ddse_dict_init (dict_init_mode_t dict_init_mode, uint version, List< const dd::Object_table > *tables, List< const Plugin_tablespace > *tablespaces)
 Initialize InnoDB for being used to store the DD tables. More...
 
bool apply_dd_undo_state (space_id_t space_id, const dd::Tablespace *dd_space)
 Save the state of undo tablespaces from the dd to the undo::Tablespace. More...
 
static void innobase_dict_register_dd_table_id (dd::Object_id dd_table_id)
 Initialize the set of hard coded DD table ids. More...
 
static bool boot_tablespaces (THD *thd, size_t *moved_count)
 Discover all InnoDB tablespaces. More...
 
static bool predefine_tablespace (dd::cache::Dictionary_client *dd_client, THD *thd, space_id_t space_id, uint32_t flags, const char *name, const char *filename)
 Create metadata for a predefined tablespace at server initialization. More...
 
static bool predefine_undo_tablespaces (dd::cache::Dictionary_client *dd_client, THD *thd)
 Predefine the undo tablespace metadata at server initialization. More...
 
static void innobase_dict_cache_reset (const char *schema_name, const char *table_name)
 Invalidate an entry or entries for partitoined table from the dict cache. More...
 
static void innobase_dict_cache_reset_tables_and_tablespaces ()
 Invalidate user table dict cache after Replication Plugin recovers. More...
 
static bool innobase_dict_recover (dict_recovery_mode_t dict_recovery_mode, uint version)
 Perform high-level recovery in InnoDB as part of initializing the data dictionary. More...
 
static void innobase_post_recover ()
 DDL crash recovery: process the records recovered from "log_ddl" table. More...
 
static bool innobase_dict_get_server_version (uint *version)
 Get the server version id stored in the header of the dictionary tablespace. More...
 
static bool innobase_dict_set_server_version ()
 Store the current server version number into the header of the dictionary tablespace. More...
 
static int innobase_page_track_start (uint64_t *start_id)
 Start page tracking. More...
 
static int innobase_page_track_stop (uint64_t *stop_id)
 Stop page tracking. More...
 
static int innobase_page_track_purge (uint64_t *purge_id)
 Purge page tracking data. More...
 
static int innobase_page_track_get_page_ids (Page_Track_Callback cbk_func, void *cbk_ctx, uint64_t *start_id, uint64_t *stop_id, unsigned char *buffer, size_t buffer_len)
 Fetch tracked pages. More...
 
static int innobase_page_track_get_num_page_ids (uint64_t *start_id, uint64_t *stop_id, uint64_t *num_pages)
 Fetch approximate number of tracked pages in the given range. More...
 
static void innobase_page_track_get_status (std::vector< std::pair< lsn_t, bool >> &status)
 Fetch the page tracking status. More...
 
static bool innobase_is_dict_readonly ()
 Check if InnoDB is in a mode where the data dictionary is read-only. More...
 
static bool innobase_is_supported_system_table (const char *db, const char *table_name, bool is_sql_layer_system_table)
 This function checks if the given db.tablename is a system table supported by Innodb and is used as an initializer for the data member is_supported_system_table of InnoDB storage engine handlerton. More...
 
bool innobase_encryption_key_rotation ()
 Rotate the encrypted tablespace keys according to master key rotation. More...
 
static uint innobase_partition_flags ()
 Return partitioning flags. More...
 
static void innodb_log_checksums_func_update (bool check)
 Update log_checksum_algorithm_ptr with a pointer to the function corresponding to whether checksums are enabled. More...
 
static void innodb_undo_tablespaces_deprecate ()
 Validate innodb_undo_tablespaces. More...
 
static void innodb_buffer_pool_size_init ()
 Initialize and normalize innodb_buffer_pool_size. More...
 
static int innodb_log_file_size_init ()
 Initialize and normalize innodb_log_file_size and innodb_log_files_in_group. More...
 
static int innodb_init_params ()
 Initialize, validate and normalize the InnoDB startup parameters. More...
 
static int innodb_init (void *p)
 Initialize the InnoDB storage engine plugin. More...
 
static bool dd_create_hardcoded (space_id_t space_id, const char *filename)
 Create a hard-coded tablespace file at server initialization. More...
 
static bool dd_open_hardcoded (space_id_t space_id, const char *filename)
 Open a hard-coded tablespace file at server initialization. More...
 
void innobase_commit_low (trx_t *trx)
 Commits a transaction in an InnoDB database. More...
 
static int innobase_rollback_trx (trx_t *trx)
 Rolls back a transaction. More...
 
static ulint get_zip_shift_size (ulint key_block_size)
 ** InnoDB database tables More...
 
static void test_normalize_table_name_low ()
 
static void test_ut_format_name ()
 
bool innobase_match_index_columns (const KEY *key_info, const dict_index_t *index_info)
 Match index columns between MySQL and InnoDB. More...
 
static void innobase_vcol_build_templ (const TABLE *table, const dict_index_t *clust_index, Field *field, const dict_col_t *col, mysql_row_templ_t *templ, ulint col_no)
 Build a template for a base column for a virtual column. 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_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...
 
static bool innobase_build_index_translation (const TABLE *table, dict_table_t *ib_table, INNOBASE_SHARE *share)
 This function builds a translation table in INNOBASE_SHARE structure for fast index location with mysql array number from its table->key_info structure. More...
 
static dict_index_tinnobase_index_lookup (INNOBASE_SHARE *share, uint keynr)
 This function uses index translation table to quickly locate the requested index structure. More...
 
int innobase_fts_text_cmp (const void *cs, const void *p1, const void *p2)
 compare two character string according to their charset. More...
 
int innobase_fts_text_case_cmp (const void *cs, const void *p1, const void *p2)
 compare two character string case insensitively according to their charset. More...
 
ulint innobase_strnxfrm (const CHARSET_INFO *cs, const uchar *str, const ulint len)
 Get the first character's code position for FTS index partition. More...
 
int innobase_fts_text_cmp_prefix (const void *cs, const void *p1, const void *p2)
 compare two character string according to their charset. More...
 
size_t innobase_fts_casedn_str (CHARSET_INFO *cs, char *src, size_t src_len, char *dst, size_t dst_len)
 Makes all characters in a string lower case. More...
 
ulint innobase_mysql_fts_get_token (CHARSET_INFO *cs, const byte *start, const byte *end, fts_string_t *token)
 Get the next token from the given string and store it in *token. More...
 
ulint get_innobase_type_from_mysql_type (ulint *unsigned_flag, const void *f)
 Converts a MySQL type to an InnoDB type. More...
 
ulint get_innobase_type_from_mysql_dd_type (ulint *unsigned_flag, ulint *binary_type, ulint *charset_no, dd::enum_column_types dd_type, const CHARSET_INFO *field_charset, bool is_unsigned)
 Converts a MySQL data-dictionary type to an InnoDB type. More...
 
static uint innobase_read_from_2_little_endian (const uchar *buf)
 Reads an unsigned integer value < 64k from 2 bytes, in the little-endian storage format. More...
 
static const Fieldbuild_template_needs_field (ibool index_contains, ibool read_just_key, ibool fetch_all_in_key, ibool fetch_primary_key_cols, dict_index_t *index, const TABLE *table, ulint i, ulint num_v)
 Determines if a field is needed in a m_prebuilt struct 'template'. More...
 
bool build_template_needs_field_in_icp (const dict_index_t *index, const row_prebuilt_t *prebuilt, bool contains, ulint i, bool is_virtual)
 Determines if a field is needed in a m_prebuilt struct 'template'. More...
 
static mysql_row_templ_tbuild_template_field (row_prebuilt_t *prebuilt, dict_index_t *clust_index, dict_index_t *index, TABLE *table, const Field *field, ulint i, ulint v_no)
 Adds a field to a m_prebuilt struct 'template'. More...
 
static void innobase_store_multi_value_low (json_binary::Value *bv, multi_value_data **valuep, Field_typed_array *fld, dfield_t *dfield, ulint comp, mem_heap_t *heap)
 Parse out multi-value and store in a multi_value_data struct. More...
 
static bool innobase_store_multi_value (json_binary::Value &v, multi_value_data *value, Field_typed_array *fld, dfield_t *dfield, bool comp, mem_heap_t *heap)
 Handle the multi-value array, parse the values and store them. More...
 
void innobase_get_multi_value (const TABLE *mysql_table, ulint f_idx, dfield_t *dfield, multi_value_data *value, uint old_val, ulint comp, mem_heap_t *heap)
 Parse out multi-values from a MySQL record. More...
 
static byteinnodb_fill_old_vcol_val (row_prebuilt_t *prebuilt, dfield_t *vfield, ulint o_len, dict_col_t *col, const byte *old_mysql_row_col, ulint col_pack_len, byte *buf)
 Fill the update vector's "old_vrow" field for those non-updated, but indexed columns. More...
 
static void innobase_get_multi_value_and_diff (const TABLE *mysql_table, ulint field_idx, dfield_t *old_field, dfield_t *new_field, uint old_value, ulint comp, mem_heap_t *heap)
 Parse out multi-values from both old and new MySQL records, at the meantime, calculate the difference between two records. More...
 
static dberr_t calc_row_difference (upd_t *uvect, const uchar *old_row, uchar *new_row, TABLE *table, uchar *upd_buff, ulint buff_len, row_prebuilt_t *prebuilt, THD *thd)
 Checks which fields have changed in a row and stores information of them to an update vector. More...
 
page_cur_mode_t convert_search_mode_to_innobase (ha_rkey_function find_flag)
 Converts a search mode flag understood by MySQL to a flag understood by InnoDB. More...
 
static void innobase_fts_create_doc_id_key (dtuple_t *tuple, const dict_index_t *index, doc_id_t *doc_id)
 Set up search tuple for a query through FTS_DOC_ID_INDEX on supplied Doc ID. 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...
 
template<typename Index >
const dd::Indexget_my_dd_index (const Index *index)
 
template<>
const dd::Indexget_my_dd_index< dd::Index > (const dd::Index *dd_index)
 
template<>
const dd::Indexget_my_dd_index< dd::Partition_index > (const dd::Partition_index *dd_index)
 
int create_index (trx_t *trx, const TABLE *form, uint32_t flags, const char *table_name, uint key_num, const dd::Table *dd_table)
 Creates an index in an InnoDB database. More...
 
int create_clustered_index_when_no_primary (trx_t *trx, uint32_t flags, const char *table_name)
 Creates an index to an InnoDB table when the user has defined no primary index. More...
 
static int validate_tablespace_name (ts_command_type ts_command, const char *name)
 Validate the tablespace name provided for a tablespace DDL. More...
 
ibool innobase_fts_load_stopword (dict_table_t *table, trx_t *trx, THD *thd)
 Initialize the table FTS stopword list. More...
 
static ulint innobase_parse_merge_threshold (THD *thd, const char *str)
 Parse MERGE_THRESHOLD value from the string. 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...
 
static bool innobase_is_base_s_col (const TABLE *table, const char *name)
 Check a column (name) is a base column for any stored column in the table. More...
 
static dberr_t innobase_check_fk_base_col (const dd::Table *dd_table, const TABLE *table)
 Check any cascading foreign key columns are base columns for any stored columns in the table. More...
 
template int create_table_info_t::create_table_update_global_dd< dd::Table > (dd::Table *)
 
template int create_table_info_t::create_table_update_global_dd< dd::Partition > (dd::Partition *)
 
template int innobase_basic_ddl::create_impl< dd::Table > (THD *, const char *, TABLE *, HA_CREATE_INFO *, dd::Table *, bool, bool, bool, ulint, ulint)
 
template int innobase_basic_ddl::create_impl< dd::Partition > (THD *, const char *, TABLE *, HA_CREATE_INFO *, dd::Partition *, bool, bool, bool, ulint, ulint)
 
template int innobase_basic_ddl::delete_impl< dd::Table > (THD *, const char *, const dd::Table *)
 
template int innobase_basic_ddl::delete_impl< dd::Partition > (THD *, const char *, const dd::Partition *)
 
template int innobase_basic_ddl::rename_impl< dd::Table > (THD *, const char *, const char *, const dd::Table *, const dd::Table *)
 
template int innobase_basic_ddl::rename_impl< dd::Partition > (THD *, const char *, const char *, const dd::Partition *, const dd::Partition *)
 
static bool dd_is_only_column (const dd::Index *index, const dd::Column *column)
 Check if a column is the only column in an index. More...
 
static int validate_create_tablespace_info (ib_file_suffix type, THD *thd, st_alter_tablespace *alter_info)
 Validate the parameters in st_alter_tablespace before using them in InnoDB tablespace functions. More...
 
static int innodb_create_tablespace (handlerton *hton, THD *thd, st_alter_tablespace *alter_info, dd::Tablespace *dd_space)
 CREATE a tablespace. More...
 
static int innobase_alter_encrypt_tablespace (handlerton *hton, THD *thd, st_alter_tablespace *alter_info, const dd::Tablespace *old_dd_space, dd::Tablespace *new_dd_space)
 Alter Encrypt/Unencrypt a tablespace. More...
 
static int innodb_alter_tablespace (handlerton *hton, THD *thd, st_alter_tablespace *alter_info, const dd::Tablespace *old_dd_space, dd::Tablespace *new_dd_space)
 ALTER an undo tablespace. More...
 
static int innodb_drop_tablespace (handlerton *hton, THD *thd, st_alter_tablespace *alter_info, const dd::Tablespace *dd_space)
 DROP a tablespace. More...
 
static int innodb_create_undo_tablespace (handlerton *hton, THD *thd, st_alter_tablespace *alter_info, dd::Tablespace *dd_space)
 CREATE an undo tablespace. More...
 
static int innodb_alter_undo_tablespace_active (handlerton *hton, THD *thd, undo::Tablespace *undo_space, dd::String_type dd_state, dd::Tablespace *dd_space)
 ALTER an undo tablespace to ACTIVE. More...
 
static int innodb_alter_undo_tablespace_inactive (handlerton *hton, THD *thd, undo::Tablespace *undo_space, dd::String_type dd_state, dd::Tablespace *dd_space)
 ALTER an undo tablespace to INACTIVE. More...
 
static int innodb_alter_undo_tablespace (handlerton *hton, THD *thd, st_alter_tablespace *alter_info, dd::Tablespace *dd_space)
 ALTER an undo tablespace. More...
 
static int innodb_drop_undo_tablespace (handlerton *hton, THD *thd, st_alter_tablespace *alter_info, const dd::Tablespace *dd_space)
 DROP an undo tablespace. More...
 
void innodb_set_buf_pool_size (long long buf_pool_size)
 Update the system variable with the given value of the InnoDB buffer pool size. More...
 
static int innobase_get_mysql_key_number_for_index (INNOBASE_SHARE *share, const TABLE *table, dict_table_t *ib_table, const dict_index_t *index)
 Calculates the key number used inside MySQL for an Innobase index. 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...
 
static ulonglong innobase_peek_autoinc (dict_table_t *innodb_table, bool print_note)
 Read the auto_increment counter of a table, using the AUTOINC lock irrespective of innodb_autoinc_lock_mode. More...
 
static void calculate_delete_length_stat (const dict_table_t *ib_table, ha_statistics *stats, THD *thd)
 Calculate delete length statistic. More...
 
static void calculate_index_size_stats (const dict_table_t *ib_table, ib_uint64_t n_rows, ulint stat_clustered_index_size, ulint stat_sum_of_other_index_sizes, ha_statistics *stats)
 Calculate stats based on index size. More...
 
double index_pct_cached (const dict_index_t *index)
 Estimate what percentage of an index's pages are cached in the buffer pool. More...
 
static ib_uint64_t innodb_get_auto_increment_for_uncached (dd::Object_id se_private_id, const dd::Properties &tbl_se_private_data)
 Get the autoincrement for the given table id which is not in the cache. More...
 
static bool innodb_get_table_statistics_for_uncached (const char *db_name, const char *tbl_name, const char *norm_name, dd::Object_id se_private_id, const dd::Properties &ts_se_private_data, const dd::Properties &tbl_se_private_data, ulint stat_flags, ha_statistics *stats)
 Retrieves table statistics only for uncache table only. More...
 
static FOREIGN_KEY_INFOget_foreign_key_info (THD *thd, dict_foreign_t *foreign)
 Maps a InnoDB foreign key constraint to a equivalent MySQL foreign key info. More...
 
static void get_table_name_info (THD *thd, st_handler_tablename *f_key_info, const dict_foreign_t *foreign)
 Get the table name and database name for the given table. More...
 
static void innodb_export_status ()
 Here we export InnoDB status variables to MySQL. More...
 
static int innodb_show_mutex_status (handlerton *hton, THD *thd, stat_print_fn *stat_print)
 Implements the SHOW MUTEX STATUS command, for mutexes. More...
 
static int innodb_show_rwlock_status (handlerton *hton, THD *thd, stat_print_fn *stat_print)
 Implements the SHOW MUTEX STATUS command. More...
 
static int innodb_show_latch_status (handlerton *hton, THD *thd, stat_print_fn *stat_print)
 Implements the SHOW MUTEX STATUS command. More...
 
ulint innobase_get_at_most_n_mbchars (ulint charset_id, ulint prefix_len, ulint data_len, const char *str)
 This function is used to find the storage length in bytes of the first n characters for prefix indexes using a multibyte character set. More...
 
static void innodb_io_capacity_max_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_io_capacity_max using the "saved" value. More...
 
static void innodb_io_capacity_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_io_capacity using the "saved" value. More...
 
static void innodb_max_dirty_pages_pct_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_max_dirty_pages_pct using the "saved" value. More...
 
static void innodb_max_dirty_pages_pct_lwm_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_max_dirty_pages_pct_lwm using the "saved" value. More...
 
static void innodb_srv_buffer_pool_in_core_file_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 
static bool innodb_buffer_pool_size_validate (THD *thd, longlong buffer_pool_size, ulint &aligned_buffer_pool_size)
 Validate the requested buffer pool size. More...
 
static void innodb_buffer_pool_size_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_buffer_pool_size using the "saved" value. More...
 
static void innobase_deadlock_detect_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innobase_deadlock_detect using the "saved" value. More...
 
static int innodb_internal_table_validate (THD *thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
 Check whether valid argument given to "innodb_fts_internal_tbl_name" This function is registered as a callback with MySQL. More...
 
static void innodb_internal_table_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update global variable "fts_internal_tbl_name" with the "saved" stopword table name value. More...
 
static void innodb_adaptive_hash_index_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_adaptive_hash_index using the "saved" value. More...
 
static void innodb_cmp_per_index_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_cmp_per_index using the "saved" value. More...
 
static void innodb_old_blocks_pct_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_old_blocks_pct using the "saved" value. More...
 
static void innodb_change_buffer_max_size_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_old_blocks_pct using the "saved" value. More...
 
static void innodb_save_page_no (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Save an InnoDB page number. More...
 
static void innodb_make_page_dirty (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Make the first page of given user tablespace dirty. More...
 
static void innodb_monitor_set_option (const monitor_info_t *monitor_info, mon_option_t set_option)
 Update the monitor counter according to the "set_option", turn on/off or reset specified monitor counter. More...
 
static void innodb_monitor_update_wildcard (const char *name, mon_option_t set_option)
 Find matching InnoDB monitor counters and update their status according to the "set_option", turn on/off or reset specified monitor counter. More...
 
static ulint innodb_monitor_id_by_name_get (const char *name)
 Given a configuration variable name, find corresponding monitor counter and return its monitor ID if found. More...
 
static ibool innodb_monitor_validate_wildcard_name (const char *name)
 Validate that the passed in monitor name matches at least one monitor counter name with wildcard compare. More...
 
static int innodb_monitor_valid_byname (void *save, const char *name)
 Validate the passed in monitor name, find and save the corresponding monitor name in the function parameter "save". More...
 
static int innodb_monitor_validate (THD *thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
 Validate passed-in "value" is a valid monitor counter name. More...
 
static void innodb_monitor_update (THD *thd, void *var_ptr, const void *save, mon_option_t set_option, ibool free_mem)
 Update the system variable innodb_enable(disable/reset/reset_all)_monitor according to the "set_option" and turn on/off or reset specified monitor counter. More...
 
static bool innodb_buffer_pool_evict_uncompressed (void)
 Evict all uncompressed pages of compressed tables from the buffer pool. More...
 
static void innodb_buffer_pool_evict_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Called on SET GLOBAL innodb_buffer_pool_evict=... More...
 
static void innodb_enable_monitor_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_monitor_enable and enable specified monitor counter. More...
 
static void innodb_disable_monitor_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_monitor_disable and turn off specified monitor counter. More...
 
static void innodb_reset_monitor_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_monitor_reset and reset specified monitor counter(s). More...
 
static void innodb_reset_all_monitor_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_monitor_reset_all and reset all value related monitor counter. More...
 
static void innodb_undo_tablespaces_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Validate the value of innodb_undo_tablespaces global variable. More...
 
int check_func_bool (THD *, SYS_VAR *, void *save, st_mysql_value *value)
 
static int validate_innodb_undo_log_encrypt (THD *thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
 Validate the value of innodb_undo_log_encrypt global variable. More...
 
static int validate_innodb_redo_log_encrypt (THD *thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
 Validate the value of innodb_redo_log_encrypt global variable. More...
 
static void innodb_rollback_segments_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the number of rollback segments per tablespace when the system variable innodb_rollback_segments is changed. More...
 
static int show_innodb_vars (THD *thd, SHOW_VAR *var, char *buff)
 Callback function for accessing the InnoDB variables from MySQL: SHOW VARIABLES. 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 void wait_background_drop_list_empty (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Wait for the background drop list to become empty. More...
 
static void purge_run_now_set (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Set the purge state to RUN. More...
 
static void purge_stop_now_set (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Set the purge state to STOP. More...
 
static void checkpoint_now_set (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Force InnoDB to do sharp checkpoint. More...
 
static void checkpoint_fuzzy_now_set (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Force InnoDB to do fuzzy checkpoint. More...
 
static void checkpoint_disabled_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Updates srv_checkpoint_disabled - allowing or disallowing checkpoints. More...
 
static void buf_flush_list_now_set (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Force a dirty pages flush now. More...
 
static void innodb_merge_threshold_set_all_debug_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Override current MERGE_THRESHOLD setting for all indexes at dictionary now. More...
 
static void buffer_pool_dump_now (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Trigger a dump of the buffer pool if innodb_buffer_pool_dump_now is set to ON. More...
 
static void buffer_pool_load_now (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Trigger a load of the buffer pool if innodb_buffer_pool_load_now is set to ON. More...
 
static void buffer_pool_load_abort (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Abort a load of the buffer pool if innodb_buffer_pool_load_abort is set to ON. More...
 
static void innodb_log_write_ahead_size_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_log_write_ahead_size using the "saved" value. More...
 
static void innodb_log_buffer_size_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_log_buffer_size using the "saved" value. More...
 
static void innodb_thread_concurrency_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the system variable innodb_thread_concurrency using the "saved" value. More...
 
static void innodb_status_output_update (THD *, SYS_VAR *, void *var_ptr, const void *save)
 Update innodb_status_output or innodb_status_output_locks, which control InnoDB "status monitor" output to the error log. More...
 
static void innodb_log_checksums_update (THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
 Update the innodb_log_checksums parameter. More...
 
static MYSQL_SYSVAR_ENUM (checksum_algorithm, srv_checksum_algorithm, PLUGIN_VAR_RQCMDARG, "The algorithm InnoDB uses for page checksumming. Possible values are" " CRC32 (hardware accelerated if the CPU supports it)" " write crc32, allow any of the other checksums to match when reading;" " STRICT_CRC32" " write crc32, do not allow other algorithms to match when reading;" " INNODB" " write a software calculated checksum, allow any other checksums" " to match when reading;" " STRICT_INNODB" " write a software calculated checksum, do not allow other algorithms" " to match when reading;" " NONE" " write a constant magic number, do not do any checksum verification" " when reading;" " STRICT_NONE" " write a constant magic number, do not allow values other than that" " magic number when reading;" " Files updated when this option is set to crc32 or strict_crc32 will" " not be readable by MySQL versions older than 5.6.3", NULL, NULL, SRV_CHECKSUM_ALGORITHM_CRC32, &innodb_checksum_algorithm_typelib)
 
static MYSQL_SYSVAR_BOOL (log_checksums, srv_log_checksums, PLUGIN_VAR_RQCMDARG, "Whether to compute and require checksums for InnoDB redo log blocks", NULL, innodb_log_checksums_update, TRUE)
 
static MYSQL_SYSVAR_STR (data_home_dir, innobase_data_home_dir, PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "The common part for InnoDB table spaces.", NULL, NULL, NULL)
 
static MYSQL_SYSVAR_BOOL (doublewrite, innobase_use_doublewrite, PLUGIN_VAR_NOCMDARG|PLUGIN_VAR_READONLY, "Enable InnoDB doublewrite buffer (enabled by default)." " Disable with --skip-innodb-doublewrite.", NULL, NULL, TRUE)
 
static MYSQL_SYSVAR_BOOL (stats_include_delete_marked, srv_stats_include_delete_marked, PLUGIN_VAR_OPCMDARG, "Include delete marked records when calculating persistent statistics", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_ULONG (io_capacity, srv_io_capacity, PLUGIN_VAR_RQCMDARG, "Number of IOPs the server can do. Tunes the background IO rate", NULL, innodb_io_capacity_update, 200, 100, ~0UL, 0)
 
static MYSQL_SYSVAR_ULONG (io_capacity_max, srv_max_io_capacity, PLUGIN_VAR_RQCMDARG, "Limit to which innodb_io_capacity can be inflated.", NULL, innodb_io_capacity_max_update, SRV_MAX_IO_CAPACITY_DUMMY_DEFAULT, 100, SRV_MAX_IO_CAPACITY_LIMIT, 0)
 
static MYSQL_SYSVAR_BOOL (background_drop_list_empty, innodb_background_drop_list_empty, PLUGIN_VAR_OPCMDARG, "Wait for the background drop list to become empty", NULL, wait_background_drop_list_empty, FALSE)
 
static MYSQL_SYSVAR_BOOL (purge_run_now, innodb_purge_run_now, PLUGIN_VAR_OPCMDARG, "Set purge state to RUN", NULL, purge_run_now_set, FALSE)
 
static MYSQL_SYSVAR_BOOL (purge_stop_now, innodb_purge_stop_now, PLUGIN_VAR_OPCMDARG, "Set purge state to STOP", NULL, purge_stop_now_set, FALSE)
 
static MYSQL_SYSVAR_BOOL (log_checkpoint_now, innodb_log_checkpoint_now, PLUGIN_VAR_OPCMDARG, "Force sharp checkpoint now", NULL, checkpoint_now_set, FALSE)
 
static MYSQL_SYSVAR_BOOL (log_checkpoint_fuzzy_now, innodb_log_checkpoint_fuzzy_now, PLUGIN_VAR_OPCMDARG, "Force fuzzy checkpoint now", NULL, checkpoint_fuzzy_now_set, FALSE)
 
static MYSQL_SYSVAR_BOOL (checkpoint_disabled, srv_checkpoint_disabled, PLUGIN_VAR_OPCMDARG, "Disable checkpoints", NULL, checkpoint_disabled_update, FALSE)
 
static MYSQL_SYSVAR_BOOL (buf_flush_list_now, innodb_buf_flush_list_now, PLUGIN_VAR_OPCMDARG, "Force dirty page flush now", NULL, buf_flush_list_now_set, FALSE)
 
static MYSQL_SYSVAR_UINT (merge_threshold_set_all_debug, innodb_merge_threshold_set_all_debug, PLUGIN_VAR_RQCMDARG, "Override current MERGE_THRESHOLD setting for all indexes at dictionary" " cache by the specified value dynamically, at the time.", NULL, innodb_merge_threshold_set_all_debug_update, DICT_INDEX_MERGE_THRESHOLD_DEFAULT, 1, 50, 0)
 
static MYSQL_SYSVAR_ULONG (semaphore_wait_timeout_debug, srv_fatal_semaphore_wait_threshold, PLUGIN_VAR_RQCMDARG, "Number of seconds that a semaphore can be held. If semaphore wait crosses" "this value, server will crash", NULL, NULL, 600, 100, 600, 0)
 
static MYSQL_SYSVAR_ULONG (purge_batch_size, srv_purge_batch_size, PLUGIN_VAR_OPCMDARG, "Number of UNDO log pages to purge in one batch from the history list.", NULL, NULL, 300, 1, 5000, 0)
 
static MYSQL_SYSVAR_ULONG (purge_threads, srv_n_purge_threads, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY, "Purge threads can be from 1 to 32. Default is 4.", NULL, NULL, 4, 1, MAX_PURGE_THREADS, 0)
 
static MYSQL_SYSVAR_ULONG (sync_array_size, srv_sync_array_size, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY, "Size of the mutex/lock wait array.", NULL, NULL, 1, 1, 1024, 0)
 
static MYSQL_SYSVAR_ULONG (fast_shutdown, srv_fast_shutdown, PLUGIN_VAR_OPCMDARG, "Speeds up the shutdown process of the InnoDB storage engine. Possible" " values are 0, 1 (faster) or 2 (fastest - crash-like).", NULL, NULL, 1, 0, 2, 0)
 
static MYSQL_SYSVAR_BOOL (file_per_table, srv_file_per_table, PLUGIN_VAR_NOCMDARG, "Stores each InnoDB table to an .ibd file in the database dir.", NULL, NULL, TRUE)
 
static MYSQL_SYSVAR_STR (ft_server_stopword_table, innobase_server_stopword_table, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_MEMALLOC, "The user supplied stopword table name.", innodb_stopword_table_validate, NULL, NULL)
 
static MYSQL_SYSVAR_UINT (flush_log_at_timeout, srv_flush_log_at_timeout, PLUGIN_VAR_OPCMDARG, "Write and flush logs every (n) second.", NULL, NULL, 1, 0, 2700, 0)
 
static MYSQL_SYSVAR_ULONG (flush_log_at_trx_commit, srv_flush_log_at_trx_commit, PLUGIN_VAR_OPCMDARG, "Set to 0 (write and flush once per second)," " 1 (write and flush at each commit)," " or 2 (write at commit, flush once per second).", NULL, NULL, 1, 0, 2, 0)
 
static MYSQL_SYSVAR_ENUM (flush_method, innodb_flush_method, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "With which method to flush data", NULL, NULL, 0, &innodb_flush_method_typelib)
 
static MYSQL_SYSVAR_BOOL (force_load_corrupted, srv_load_corrupted, PLUGIN_VAR_NOCMDARG|PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "Force InnoDB to load metadata of corrupted table.", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_STR (log_group_home_dir, srv_log_group_home_dir, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "Path to InnoDB log files.", NULL, NULL, NULL)
 
static MYSQL_SYSVAR_ULONG (page_cleaners, srv_n_page_cleaners, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY, "Page cleaner threads can be from 1 to 64. Default is 4.", NULL, NULL, 4, 1, 64, 0)
 
static MYSQL_SYSVAR_DOUBLE (max_dirty_pages_pct, srv_max_buf_pool_modified_pct, PLUGIN_VAR_RQCMDARG, "Percentage of dirty pages allowed in bufferpool.", NULL, innodb_max_dirty_pages_pct_update, 90.0, 0, 99.999, 0)
 
static MYSQL_SYSVAR_DOUBLE (max_dirty_pages_pct_lwm, srv_max_dirty_pages_pct_lwm, PLUGIN_VAR_RQCMDARG, "Percentage of dirty pages at which flushing kicks in.", NULL, innodb_max_dirty_pages_pct_lwm_update, 10, 0, 99.999, 0)
 
static MYSQL_SYSVAR_ULONG (adaptive_flushing_lwm, srv_adaptive_flushing_lwm, PLUGIN_VAR_RQCMDARG, "Percentage of log capacity below which no adaptive flushing happens.", NULL, NULL, 10, 0, 70, 0)
 
static MYSQL_SYSVAR_BOOL (adaptive_flushing, srv_adaptive_flushing, PLUGIN_VAR_NOCMDARG, "Attempt flushing dirty pages to avoid IO bursts at checkpoints.", NULL, NULL, TRUE)
 
static MYSQL_SYSVAR_BOOL (flush_sync, srv_flush_sync, PLUGIN_VAR_NOCMDARG, "Allow IO bursts at the checkpoints ignoring io_capacity setting.", NULL, NULL, TRUE)
 
static MYSQL_SYSVAR_ULONG (flushing_avg_loops, srv_flushing_avg_loops, PLUGIN_VAR_RQCMDARG, "Number of iterations over which the background flushing is averaged.", NULL, NULL, 30, 1, 1000, 0)
 
static MYSQL_SYSVAR_ULONG (max_purge_lag, srv_max_purge_lag, PLUGIN_VAR_RQCMDARG, "Desired maximum length of the purge queue (0 = no limit)", NULL, NULL, 0, 0, ~0UL, 0)
 
static MYSQL_SYSVAR_ULONG (max_purge_lag_delay, srv_max_purge_lag_delay, PLUGIN_VAR_RQCMDARG, "Maximum delay of user threads in micro-seconds", NULL, NULL, 0L, 0L, 10000000UL, 0)
 
static MYSQL_SYSVAR_BOOL (rollback_on_timeout, innobase_rollback_on_timeout, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY, "Roll back the complete transaction on lock wait " "timeout, for 4.x compatibility (disabled by default)", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_BOOL (status_file, innobase_create_status_file, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_NOSYSVAR, "Enable SHOW ENGINE INNODB STATUS output in the innodb_status.<pid> file", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_BOOL (stats_on_metadata, innobase_stats_on_metadata, PLUGIN_VAR_OPCMDARG, "Enable statistics gathering for metadata commands such as" " SHOW TABLE STATUS for tables that use transient statistics (off by " "default)", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_ULONGLONG (stats_transient_sample_pages, srv_stats_transient_sample_pages, PLUGIN_VAR_RQCMDARG, "The number of leaf index pages to sample when calculating transient" " statistics (if persistent statistics are not used, default 8)", NULL, NULL, 8, 1, ~0ULL, 0)
 
static MYSQL_SYSVAR_BOOL (stats_persistent, srv_stats_persistent, PLUGIN_VAR_OPCMDARG, "InnoDB persistent statistics enabled for all tables unless overridden" " at table level", NULL, NULL, TRUE)
 
static MYSQL_SYSVAR_BOOL (stats_auto_recalc, srv_stats_auto_recalc, PLUGIN_VAR_OPCMDARG, "InnoDB automatic recalculation of persistent statistics enabled for all" " tables unless overridden at table level (automatic recalculation is only" " done when InnoDB decides that the table has changed too much and needs a" " new statistics)", NULL, NULL, TRUE)
 
static MYSQL_SYSVAR_ULONGLONG (stats_persistent_sample_pages, srv_stats_persistent_sample_pages, PLUGIN_VAR_RQCMDARG, "The number of leaf index pages to sample when calculating persistent" " statistics (by ANALYZE, default 20)", NULL, NULL, 20, 1, ~0ULL, 0)
 
static MYSQL_SYSVAR_BOOL (adaptive_hash_index, btr_search_enabled, PLUGIN_VAR_OPCMDARG, "Enable InnoDB adaptive hash index (enabled by default). " " Disable with --skip-innodb-adaptive-hash-index.", NULL, innodb_adaptive_hash_index_update, true)
 
static MYSQL_SYSVAR_ULONG (adaptive_hash_index_parts, btr_ahi_parts, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY, "Number of InnoDB Adapative Hash Index Partitions. (default = 8). ", NULL, NULL, 8, 1, 512, 0)
 Number of distinct partitions of AHI. More...
 
static MYSQL_SYSVAR_ULONG (replication_delay, srv_replication_delay, PLUGIN_VAR_RQCMDARG, "Replication thread delay (ms) on the slave server if" " innodb_thread_concurrency is reached (0 by default)", NULL, NULL, 0, 0, ~0UL, 0)
 
static MYSQL_SYSVAR_UINT (compression_level, page_zip_level, PLUGIN_VAR_RQCMDARG, "Compression level used for compressed row format. 0 is no compression" ", 1 is fastest, 9 is best compression and default is 6.", NULL, NULL, DEFAULT_COMPRESSION_LEVEL, 0, 9, 0)
 
static MYSQL_SYSVAR_BOOL (log_compressed_pages, page_zip_log_pages, PLUGIN_VAR_OPCMDARG, "Enables/disables the logging of entire compressed page images." " InnoDB logs the compressed pages to prevent corruption if" " the zlib compression algorithm changes." " When turned OFF, InnoDB will assume that the zlib" " compression algorithm doesn't change.", NULL, NULL, TRUE)
 
static MYSQL_SYSVAR_ULONG (autoextend_increment, sys_tablespace_auto_extend_increment, PLUGIN_VAR_RQCMDARG, "Data file autoextend increment in megabytes", NULL, NULL, 64L, 1L, 1000L, 0)
 
static MYSQL_SYSVAR_BOOL (dedicated_server, srv_dedicated_server, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_NOPERSIST|PLUGIN_VAR_READONLY, "Automatically scale innodb_buffer_pool_size and innodb_log_file_size " "based on system memory. Also set innodb_flush_method=O_DIRECT_NO_FSYNC, " "if supported", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_LONGLONG (buffer_pool_size, srv_buf_pool_curr_size, PLUGIN_VAR_RQCMDARG, "The size of the memory buffer InnoDB uses to " "cache data and indexes of its tables.", NULL, innodb_buffer_pool_size_update, static_cast< longlong >(srv_buf_pool_def_size), static_cast< longlong >(srv_buf_pool_min_size), longlong{srv_buf_pool_max_size}, 1024 *1024L)
 
static MYSQL_SYSVAR_ULONGLONG (buffer_pool_chunk_size, srv_buf_pool_chunk_unit, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Size of a single memory chunk within each buffer pool instance" " for resizing buffer pool. Online buffer pool resizing happens" " at this granularity.", NULL, NULL, 128 *1024 *1024, ulonglong{srv_buf_pool_chunk_unit_min}, ulonglong{srv_buf_pool_chunk_unit_max}, ulonglong{srv_buf_pool_chunk_unit_blk_sz})
 
static MYSQL_SYSVAR_ULONG (page_hash_locks, srv_n_page_hash_locks, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY, "Number of rw_locks protecting buffer pool " "page_hash. Rounded up to the next power of 2", NULL, NULL, 16, 1, MAX_PAGE_HASH_LOCKS, 0)
 
static MYSQL_SYSVAR_ULONG (doublewrite_batch_size, srv_doublewrite_batch_size, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY, "Number of pages reserved in doublewrite buffer for batch flushing", NULL, NULL, 120, 1, 127, 0)
 
static MYSQL_SYSVAR_ULONG (buffer_pool_instances, srv_buf_pool_instances, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Number of buffer pool instances, set to higher " "value on high-end machines to increase scalability", NULL, NULL, srv_buf_pool_instances_default, 0, MAX_BUFFER_POOLS, 0)
 
static MYSQL_SYSVAR_STR (buffer_pool_filename, srv_buf_dump_filename, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, "Filename to/from which to dump/load the InnoDB buffer pool", innodb_srv_buf_dump_filename_validate, NULL, SRV_BUF_DUMP_FILENAME_DEFAULT)
 
static MYSQL_SYSVAR_BOOL (buffer_pool_dump_now, innodb_buffer_pool_dump_now, PLUGIN_VAR_RQCMDARG, "Trigger an immediate dump of the buffer pool into a " "file named @@innodb_buffer_pool_filename", NULL, buffer_pool_dump_now, FALSE)
 
static MYSQL_SYSVAR_BOOL (buffer_pool_dump_at_shutdown, srv_buffer_pool_dump_at_shutdown, PLUGIN_VAR_RQCMDARG, "Dump the buffer pool into a file named @@innodb_buffer_pool_filename", NULL, NULL, TRUE)
 
static MYSQL_SYSVAR_BOOL (buffer_pool_in_core_file, srv_buffer_pool_in_core_file, PLUGIN_VAR_NOCMDARG, "This option has no effect if @@core_file is OFF. " "If @@core_file is ON, and this option is OFF, then the core dump file will" " be generated only if it is possible to exclude buffer pool from it. " "As soon as it will be determined that such exclusion is impossible a " "warning will be emitted and @@core_file will be set to OFF to prevent " "generating a core dump. " "If this option is enabled (which is the default), then core dumping " "logic will not be affected. ", NULL, innodb_srv_buffer_pool_in_core_file_update, TRUE)
 
static MYSQL_SYSVAR_ULONG (buffer_pool_dump_pct, srv_buf_pool_dump_pct, PLUGIN_VAR_RQCMDARG, "Dump only the hottest N% of each buffer pool, defaults to 25", NULL, NULL, 25, 1, 100, 0)
 
static MYSQL_SYSVAR_ULONG (idle_flush_pct, srv_idle_flush_pct, PLUGIN_VAR_RQCMDARG, "Up to what percentage of dirty pages to be flushed when server is found" " idle.", NULL, NULL, srv_idle_flush_pct_default, 0, 100, 0)
 
static MYSQL_SYSVAR_STR (buffer_pool_evict, srv_buffer_pool_evict, PLUGIN_VAR_RQCMDARG, "Evict pages from the buffer pool", NULL, innodb_buffer_pool_evict_update, "")
 
static MYSQL_SYSVAR_BOOL (buffer_pool_load_now, innodb_buffer_pool_load_now, PLUGIN_VAR_RQCMDARG, "Trigger an immediate load of the buffer pool from a " "file named @@innodb_buffer_pool_filename", NULL, buffer_pool_load_now, FALSE)
 
static MYSQL_SYSVAR_BOOL (buffer_pool_load_abort, innodb_buffer_pool_load_abort, PLUGIN_VAR_RQCMDARG, "Abort a currently running load of the buffer pool", NULL, buffer_pool_load_abort, FALSE)
 
static MYSQL_SYSVAR_BOOL (buffer_pool_load_at_startup, srv_buffer_pool_load_at_startup, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "Load the buffer pool from a file named @@innodb_buffer_pool_filename", NULL, NULL, TRUE)
 
static MYSQL_SYSVAR_ULONG (lru_scan_depth, srv_LRU_scan_depth, PLUGIN_VAR_RQCMDARG, "How deep to scan LRU to keep it clean", NULL, NULL, 1024, 100, ~0UL, 0)
 
static MYSQL_SYSVAR_ULONG (flush_neighbors, srv_flush_neighbors, PLUGIN_VAR_OPCMDARG, "Set to 0 (don't flush neighbors from buffer pool)," " 1 (flush contiguous neighbors from buffer pool)" " or 2 (flush neighbors from buffer pool)," " when flushing a block", NULL, NULL, 0, 0, 2, 0)
 
static MYSQL_SYSVAR_ULONG (commit_concurrency, innobase_commit_concurrency, PLUGIN_VAR_RQCMDARG, "Helps in performance tuning in heavily concurrent environments.", innobase_commit_concurrency_validate, NULL, 0, 0, 1000, 0)
 
static MYSQL_SYSVAR_ULONG (concurrency_tickets, srv_n_free_tickets_to_enter, PLUGIN_VAR_RQCMDARG, "Number of times a thread is allowed to enter InnoDB " "within the same SQL query after it has once got the " "ticket", NULL, NULL, 5000L, 1L, UINT_MAX, 0)
 
static MYSQL_SYSVAR_BOOL (deadlock_detect, innobase_deadlock_detect, PLUGIN_VAR_NOCMDARG, "Enable/disable InnoDB deadlock detector (default ON)." " if set to OFF, deadlock detection is skipped," " and we rely on innodb_lock_wait_timeout in case of deadlock.", NULL, innobase_deadlock_detect_update, TRUE)
 
static MYSQL_SYSVAR_LONG (fill_factor, innobase_fill_factor, PLUGIN_VAR_RQCMDARG, "Percentage of B-tree page filled during bulk insert", NULL, NULL, 100, 10, 100, 0)
 
static MYSQL_SYSVAR_BOOL (ft_enable_diag_print, fts_enable_diag_print, PLUGIN_VAR_OPCMDARG, "Whether to enable additional FTS diagnostic printout ", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_BOOL (disable_sort_file_cache, srv_disable_sort_file_cache, PLUGIN_VAR_OPCMDARG, "Whether to disable OS system file cache for sort I/O", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_STR (ft_aux_table, fts_internal_tbl_name2, PLUGIN_VAR_NOCMDARG, "FTS internal auxiliary table to be checked", innodb_internal_table_validate, innodb_internal_table_update, NULL)
 
static MYSQL_SYSVAR_ULONG (ft_cache_size, fts_max_cache_size, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "InnoDB Fulltext search cache size in bytes", NULL, NULL, 8000000, 1600000, 80000000, 0)
 
static MYSQL_SYSVAR_ULONG (ft_total_cache_size, fts_max_total_cache_size, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Total memory allocated for InnoDB Fulltext Search cache", NULL, NULL, 640000000, 32000000, 1600000000, 0)
 
static MYSQL_SYSVAR_ULONG (ft_result_cache_limit, fts_result_cache_limit, PLUGIN_VAR_RQCMDARG, "InnoDB Fulltext search query result cache limit in bytes", NULL, NULL, 2000000000L, 1000000L, 4294967295UL, 0)
 
static MYSQL_SYSVAR_ULONG (ft_min_token_size, fts_min_token_size, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "InnoDB Fulltext search minimum token size in characters", NULL, NULL, 3, 0, 16, 0)
 
static MYSQL_SYSVAR_ULONG (ft_max_token_size, fts_max_token_size, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "InnoDB Fulltext search maximum token size in characters", NULL, NULL, FTS_MAX_WORD_LEN_IN_CHAR, 10, FTS_MAX_WORD_LEN_IN_CHAR, 0)
 
static MYSQL_SYSVAR_ULONG (ft_num_word_optimize, fts_num_word_optimize, PLUGIN_VAR_OPCMDARG, "InnoDB Fulltext search number of words to optimize " "for each optimize table call ", NULL, NULL, 2000, 1000, 10000, 0)
 
static MYSQL_SYSVAR_ULONG (ft_sort_pll_degree, fts_sort_pll_degree, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "InnoDB Fulltext search parallel sort degree, will " "round up to nearest power of 2 number", NULL, NULL, 2, 1, 16, 0)
 
static MYSQL_SYSVAR_ULONG (sort_buffer_size, srv_sort_buf_size, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Memory buffer size for index creation", NULL, NULL, 1048576, 65536, 64<< 20, 0)
 
static MYSQL_SYSVAR_ULONGLONG (online_alter_log_max_size, srv_online_max_size, PLUGIN_VAR_RQCMDARG, "Maximum modification log file size for online index creation", NULL, NULL, 128<< 20, 65536, ~0ULL, 0)
 
static MYSQL_SYSVAR_BOOL (optimize_fulltext_only, innodb_optimize_fulltext_only, PLUGIN_VAR_NOCMDARG, "Only optimize the Fulltext index of the table", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_ULONG (read_io_threads, srv_n_read_io_threads, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Number of background read I/O threads in InnoDB.", NULL, NULL, 4, 1, 64, 0)
 
static MYSQL_SYSVAR_ULONG (write_io_threads, srv_n_write_io_threads, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Number of background write I/O threads in InnoDB.", NULL, NULL, 4, 1, 64, 0)
 
static MYSQL_SYSVAR_ULONG (force_recovery, srv_force_recovery, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Helps to save your data in case the disk image of " "the database becomes corrupt.", NULL, NULL, 0, 0, 6, 0)
 
static MYSQL_SYSVAR_ULONG (force_recovery_crash, srv_force_recovery_crash, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Kills the server during crash recovery.", NULL, NULL, 0, 0, 100, 0)
 
static MYSQL_SYSVAR_ULONG (page_size, srv_page_size, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "Page size to use for all InnoDB tablespaces.", NULL, NULL, UNIV_PAGE_SIZE_DEF, UNIV_PAGE_SIZE_MIN, UNIV_PAGE_SIZE_MAX, 0)
 
static MYSQL_SYSVAR_ULONG (log_buffer_size, srv_log_buffer_size, PLUGIN_VAR_RQCMDARG, "The size of the buffer which InnoDB uses to write log to the log files" " on disk.", NULL, innodb_log_buffer_size_update, INNODB_LOG_BUFFER_SIZE_DEFAULT, INNODB_LOG_BUFFER_SIZE_MIN, INNODB_LOG_BUFFER_SIZE_MAX, 1024)
 
static MYSQL_SYSVAR_ULONGLONG (log_file_size, srv_log_file_size, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Size of each log file (in bytes).", NULL, NULL, 48 *1024 *1024L, 4 *1024 *1024L, ULLONG_MAX, 1024 *1024L)
 
static MYSQL_SYSVAR_ULONG (log_files_in_group, srv_n_log_files, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Number of log files (when multiplied by innodb_log_file_size gives total " "size" " of log files). InnoDB writes to files in a circular fashion.", NULL, NULL, 2, 2, SRV_N_LOG_FILES_MAX, 0)
 
static MYSQL_SYSVAR_ULONG (log_write_ahead_size, srv_log_write_ahead_size, PLUGIN_VAR_RQCMDARG, "Log write ahead unit size to avoid read-on-write," " it should match the OS cache block IO size.", NULL, innodb_log_write_ahead_size_update, INNODB_LOG_WRITE_AHEAD_SIZE_DEFAULT, INNODB_LOG_WRITE_AHEAD_SIZE_MIN, INNODB_LOG_WRITE_AHEAD_SIZE_MAX, OS_FILE_LOG_BLOCK_SIZE)
 
static MYSQL_SYSVAR_UINT (log_spin_cpu_abs_lwm, srv_log_spin_cpu_abs_lwm, PLUGIN_VAR_RQCMDARG, "Minimum value of cpu time for which spin-delay is used." " Expressed in percentage of single cpu core.", NULL, NULL, INNODB_LOG_SPIN_CPU_ABS_LWM_DEFAULT, 0, UINT_MAX, 0)
 
static MYSQL_SYSVAR_UINT (log_spin_cpu_pct_hwm, srv_log_spin_cpu_pct_hwm, PLUGIN_VAR_RQCMDARG, "Maximum value of cpu time for which spin-delay is used." " Expressed in percentage of all cpu cores.", NULL, NULL, INNODB_LOG_SPIN_CPU_PCT_HWM_DEFAULT, 0, 100, 0)
 
static MYSQL_SYSVAR_ULONG (log_wait_for_flush_spin_hwm, srv_log_wait_for_flush_spin_hwm, PLUGIN_VAR_RQCMDARG, "Maximum value of average log flush time for which spin-delay is used." " When flushing takes longer, user threads no longer spin when waiting for" "flushed redo. Expressed in microseconds.", NULL, NULL, INNODB_LOG_WAIT_FOR_FLUSH_SPIN_HWM_DEFAULT, 0, ULONG_MAX, 0)
 
static MYSQL_SYSVAR_UINT (old_blocks_pct, innobase_old_blocks_pct, PLUGIN_VAR_RQCMDARG, "Percentage of the buffer pool to reserve for 'old' blocks.", NULL, innodb_old_blocks_pct_update, 100 *3/8, 5, 95, 0)
 
static MYSQL_SYSVAR_UINT (old_blocks_time, buf_LRU_old_threshold_ms, PLUGIN_VAR_RQCMDARG, "Move blocks to the 'new' end of the buffer pool if the first access" " was at least this many milliseconds ago." " The timeout is disabled if 0.", NULL, NULL, 1000, 0, UINT_MAX32, 0)
 
static MYSQL_SYSVAR_LONG (open_files, innobase_open_files, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "How many files at the maximum InnoDB keeps open at the same time.", NULL, NULL, 0L, 0L, LONG_MAX, 0)
 
static MYSQL_SYSVAR_ULONG (sync_spin_loops, srv_n_spin_wait_rounds, PLUGIN_VAR_RQCMDARG, "Count of spin-loop rounds in InnoDB mutexes (30 by default)", NULL, NULL, 30L, 0L, ~0UL, 0)
 
static MYSQL_SYSVAR_ULONG (spin_wait_delay, srv_spin_wait_delay, PLUGIN_VAR_OPCMDARG, "Maximum delay between polling for a spin lock (6 by default)", NULL, NULL, 6L, 0L, 1000, 0)
 
static MYSQL_SYSVAR_ULONG (spin_wait_pause_multiplier, ut::spin_wait_pause_multiplier, PLUGIN_VAR_RQCMDARG, "Controls how many times in a row to use a PAUSE " "instruction to achieve one unit of delay in a spin " "lock (see @@innodb_spin_wait_delay), defaults to 50", NULL, NULL, 50, 0, 100, 0)
 
static MYSQL_SYSVAR_ULONGLONG (fsync_threshold, os_fsync_threshold, PLUGIN_VAR_RQCMDARG, "The value of this variable determines how often InnoDB calls fsync when " "creating a new file. Default is zero which would make InnoDB flush the " "entire file at once before closing it.", NULL, NULL, 0, 0, ~0ULL, UNIV_PAGE_SIZE)
 
static MYSQL_SYSVAR_ULONG (thread_concurrency, srv_thread_concurrency, PLUGIN_VAR_RQCMDARG, "Helps in performance tuning in heavily concurrent " "environments. Sets the maximum number of threads " "allowed inside InnoDB. Value 0 will disable the " "thread throttling.", NULL, innodb_thread_concurrency_update, 0, 0, 1000, 0)
 
static MYSQL_SYSVAR_ULONG (adaptive_max_sleep_delay, srv_adaptive_max_sleep_delay, PLUGIN_VAR_RQCMDARG, "The upper limit of the sleep delay in usec. Value of 0 disables it.", NULL, NULL, 150000, 0, 1000000, 0)
 
static MYSQL_SYSVAR_ULONG (thread_sleep_delay, srv_thread_sleep_delay, PLUGIN_VAR_RQCMDARG, "Time of innodb thread sleeping before joining InnoDB queue (usec)." " Value 0 disable a sleep", NULL, NULL, 10000L, 0L, 1000000L, 0)
 
static MYSQL_SYSVAR_STR (data_file_path, innobase_data_file_path, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "Path to individual files and their sizes.", NULL, NULL,(char *)"ibdata1:12M:autoextend")
 
static MYSQL_SYSVAR_STR (temp_data_file_path, innobase_temp_data_file_path, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "Path to files and their sizes making temp-tablespace.", NULL, NULL,(char *)"ibtmp1:12M:autoextend")
 
static MYSQL_SYSVAR_STR (undo_directory, srv_undo_dir, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "Directory where undo tablespace files live, this path can be absolute.", NULL, NULL, NULL)
 
static MYSQL_SYSVAR_STR (temp_tablespaces_dir, ibt::srv_temp_dir, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "Directory where temp tablespace files live, this path can be absolute.", NULL, NULL, NULL)
 
static MYSQL_SYSVAR_ULONG (undo_tablespaces, srv_undo_tablespaces, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_NOPERSIST, "Number of undo tablespaces to use. (deprecated)", NULL, innodb_undo_tablespaces_update, FSP_IMPLICIT_UNDO_TABLESPACES, FSP_MIN_UNDO_TABLESPACES, FSP_MAX_UNDO_TABLESPACES, 0)
 
static MYSQL_SYSVAR_ULONGLONG (max_undo_log_size, srv_max_undo_tablespace_size, PLUGIN_VAR_OPCMDARG, "Maximum size of an UNDO tablespace in MB (If an UNDO tablespace grows" " beyond this size it will be truncated in due course). ", NULL, NULL, 1024 *1024 *1024L, 10 *1024 *1024L, ~0ULL, 0)
 
static MYSQL_SYSVAR_ULONG (purge_rseg_truncate_frequency, srv_purge_rseg_truncate_frequency, PLUGIN_VAR_OPCMDARG, "Dictates rate at which UNDO records are purged. Value N means" " purge rollback segment(s) on every Nth iteration of purge invocation", NULL, NULL, 128, 1, 128, 0)
 
static MYSQL_SYSVAR_BOOL (undo_log_truncate, srv_undo_log_truncate, PLUGIN_VAR_OPCMDARG, "Enable or Disable Truncate of UNDO tablespace.", NULL, NULL, TRUE)
 
static MYSQL_SYSVAR_ULONG (rollback_segments, srv_rollback_segments, PLUGIN_VAR_OPCMDARG, "Number of rollback segments per tablespace. This applies to the system" " tablespace, the temporary tablespace & any undo tablespace.", NULL, innodb_rollback_segments_update, FSP_MAX_ROLLBACK_SEGMENTS, 1, FSP_MAX_ROLLBACK_SEGMENTS, 0)
 
static MYSQL_SYSVAR_BOOL (undo_log_encrypt, srv_undo_log_encrypt, PLUGIN_VAR_OPCMDARG, "Enable or disable Encrypt of UNDO tablespace.", validate_innodb_undo_log_encrypt, nullptr, FALSE)
 
static MYSQL_SYSVAR_LONG (autoinc_lock_mode, innobase_autoinc_lock_mode, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "The AUTOINC lock modes supported by InnoDB:" " 0 => Old style AUTOINC locking (for backward compatibility);" " 1 => New style AUTOINC locking;" " 2 => No AUTOINC locking (unsafe for SBR)", NULL, NULL, AUTOINC_NO_LOCKING, AUTOINC_OLD_STYLE_LOCKING, AUTOINC_NO_LOCKING, 0)
 
static MYSQL_SYSVAR_STR (version, innodb_version_str, PLUGIN_VAR_NOCMDOPT|PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "InnoDB version", NULL, NULL, INNODB_VERSION_STR)
 
static MYSQL_SYSVAR_BOOL (use_native_aio, srv_use_native_aio, PLUGIN_VAR_NOCMDARG|PLUGIN_VAR_READONLY, "Use native AIO if supported on this platform.", NULL, NULL, TRUE)
 
static MYSQL_SYSVAR_BOOL (api_enable_binlog, ib_binlog_enabled, PLUGIN_VAR_NOCMDARG|PLUGIN_VAR_READONLY, "Enable binlog for applications direct access InnoDB through InnoDB APIs", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_BOOL (api_enable_mdl, ib_mdl_enabled, PLUGIN_VAR_NOCMDARG|PLUGIN_VAR_READONLY, "Enable MDL for applications direct access InnoDB through InnoDB APIs", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_BOOL (api_disable_rowlock, ib_disable_row_lock, PLUGIN_VAR_NOCMDARG|PLUGIN_VAR_READONLY, "Disable row lock when direct access InnoDB through InnoDB APIs", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_ULONG (api_trx_level, ib_trx_level_setting, PLUGIN_VAR_OPCMDARG, "InnoDB API transaction isolation level", NULL, NULL, 0, 0, 3, 0)
 
static MYSQL_SYSVAR_ULONG (api_bk_commit_interval, ib_bk_commit_interval, PLUGIN_VAR_OPCMDARG, "Background commit interval in seconds", NULL, NULL, 5, 1, 1024 *1024 *1024, 0)
 
static MYSQL_SYSVAR_ENUM (change_buffering, innodb_change_buffering, PLUGIN_VAR_RQCMDARG, "Buffer changes to reduce random access:" " OFF, ON, inserting, deleting, changing, or purging.", NULL, NULL, IBUF_USE_ALL, &innodb_change_buffering_typelib)
 
static MYSQL_SYSVAR_UINT (change_buffer_max_size, srv_change_buffer_max_size, PLUGIN_VAR_RQCMDARG, "Maximum on-disk size of change buffer in terms of percentage" " of the buffer pool.", NULL, innodb_change_buffer_max_size_update, CHANGE_BUFFER_DEFAULT_SIZE, 0, 50, 0)
 
static MYSQL_SYSVAR_ENUM (stats_method, srv_innodb_stats_method, PLUGIN_VAR_RQCMDARG, "Specifies how InnoDB index statistics collection code should" " treat NULLs. Possible values are NULLS_EQUAL (default)," " NULLS_UNEQUAL and NULLS_IGNORED", NULL, NULL, SRV_STATS_NULLS_EQUAL, &innodb_stats_method_typelib)
 
static MYSQL_SYSVAR_UINT (change_buffering_debug, ibuf_debug, PLUGIN_VAR_RQCMDARG, "Debug flags for InnoDB change buffering (0=none, 2=crash at merge)", NULL, NULL, 0, 0, 2, 0)
 
static MYSQL_SYSVAR_BOOL (disable_background_merge, srv_ibuf_disable_background_merge, PLUGIN_VAR_NOCMDARG|PLUGIN_VAR_RQCMDARG, "Disable change buffering merges by the master thread", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_ENUM (compress_debug, srv_debug_compress, PLUGIN_VAR_RQCMDARG, "Compress all tables, without specifying the COMPRESS table attribute", NULL, NULL, Compression::NONE, &innodb_debug_compress_typelib)
 
static MYSQL_SYSVAR_BOOL (random_read_ahead, srv_random_read_ahead, PLUGIN_VAR_NOCMDARG, "Whether to use read ahead for random access within an extent.", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_ULONG (read_ahead_threshold, srv_read_ahead_threshold, PLUGIN_VAR_RQCMDARG, "Number of pages that must be accessed sequentially for InnoDB to" " trigger a readahead.", NULL, NULL, 56, 0, 64, 0)
 
static MYSQL_SYSVAR_STR (monitor_enable, innobase_enable_monitor_counter, PLUGIN_VAR_RQCMDARG, "Turn on a monitor counter", innodb_monitor_validate, innodb_enable_monitor_update, NULL)
 
static MYSQL_SYSVAR_STR (monitor_disable, innobase_disable_monitor_counter, PLUGIN_VAR_RQCMDARG, "Turn off a monitor counter", innodb_monitor_validate, innodb_disable_monitor_update, NULL)
 
static MYSQL_SYSVAR_STR (monitor_reset, innobase_reset_monitor_counter, PLUGIN_VAR_RQCMDARG, "Reset a monitor counter", innodb_monitor_validate, innodb_reset_monitor_update, NULL)
 
static MYSQL_SYSVAR_STR (monitor_reset_all, innobase_reset_all_monitor_counter, PLUGIN_VAR_RQCMDARG, "Reset all values for a monitor counter", innodb_monitor_validate, innodb_reset_all_monitor_update, NULL)
 
static MYSQL_SYSVAR_BOOL (status_output, srv_print_innodb_monitor, PLUGIN_VAR_OPCMDARG, "Enable InnoDB monitor output to the error log.", NULL, innodb_status_output_update, FALSE)
 
static MYSQL_SYSVAR_BOOL (status_output_locks, srv_print_innodb_lock_monitor, PLUGIN_VAR_OPCMDARG, "Enable InnoDB lock monitor output to the error log." " Requires innodb_status_output=ON.", NULL, innodb_status_output_update, FALSE)
 
static MYSQL_SYSVAR_BOOL (print_all_deadlocks, srv_print_all_deadlocks, PLUGIN_VAR_OPCMDARG, "Print all deadlocks to MySQL error log (off by default)", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_ULONG (compression_failure_threshold_pct, zip_failure_threshold_pct, PLUGIN_VAR_OPCMDARG, "If the compression failure rate of a table is greater than this number" " more padding is added to the pages to reduce the failures. A value of" " zero implies no padding", NULL, NULL, 5, 0, 100, 0)
 
static MYSQL_SYSVAR_ULONG (compression_pad_pct_max, zip_pad_max, PLUGIN_VAR_OPCMDARG, "Percentage of empty space on a data page that can be reserved" " to make the page compressible.", NULL, NULL, 50, 0, 75, 0)
 
static MYSQL_SYSVAR_BOOL (read_only, srv_read_only_mode, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "Start InnoDB in read only mode (off by default)", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_BOOL (cmp_per_index_enabled, srv_cmp_per_index_enabled, PLUGIN_VAR_OPCMDARG, "Enable INFORMATION_SCHEMA.innodb_cmp_per_index," " may have negative impact on performance (off by default)", NULL, innodb_cmp_per_index_update, FALSE)
 
static MYSQL_SYSVAR_ENUM (default_row_format, innodb_default_row_format, PLUGIN_VAR_RQCMDARG, "The default ROW FORMAT for all innodb tables created without explicit" " ROW_FORMAT. Possible values are REDUNDANT, COMPACT, and DYNAMIC." " The ROW_FORMAT value COMPRESSED is not allowed", NULL, NULL, DEFAULT_ROW_FORMAT_DYNAMIC, &innodb_default_row_format_typelib)
 
static MYSQL_SYSVAR_STR (redo_log_archive_dirs, meb::redo_log_archive_dirs, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, "Limit the location of the redo log archive to the semicolon " "separated list of labeled directories", meb::validate_redo_log_archive_dirs, NULL, NULL)
 
static MYSQL_SYSVAR_BOOL (redo_log_encrypt, srv_redo_log_encrypt, PLUGIN_VAR_OPCMDARG, "Enable or disable Encryption of REDO tablespace.", validate_innodb_redo_log_encrypt, nullptr, FALSE)
 
static MYSQL_SYSVAR_BOOL (print_ddl_logs, srv_print_ddl_logs, PLUGIN_VAR_OPCMDARG, "Print all DDl logs to MySQL error log (off by default)", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_UINT (trx_rseg_n_slots_debug, trx_rseg_n_slots_debug, PLUGIN_VAR_RQCMDARG, "Debug flags for InnoDB to limit TRX_RSEG_N_SLOTS for " "trx_rsegf_undo_find_free()", NULL, NULL, 0, 0, 1024, 0)
 
static MYSQL_SYSVAR_UINT (limit_optimistic_insert_debug, btr_cur_limit_optimistic_insert_debug, PLUGIN_VAR_RQCMDARG, "Artificially limit the number of records per B-tree page (0=unlimited).", NULL, NULL, 0, 0, UINT_MAX32, 0)
 
static MYSQL_SYSVAR_BOOL (trx_purge_view_update_only_debug, srv_purge_view_update_only_debug, PLUGIN_VAR_NOCMDARG, "Pause actual purging any delete-marked records, but " "merely update the purge view." " It is to create artificially the situation the " "purge view have been updated" " but the each purges were not done yet.", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_ULONG (fil_make_page_dirty_debug, srv_fil_make_page_dirty_debug, PLUGIN_VAR_OPCMDARG, "Make the first page of the given tablespace dirty.", NULL, innodb_make_page_dirty, 0, 0, UINT_MAX32, 0)
 
static MYSQL_SYSVAR_ULONG (saved_page_number_debug, srv_saved_page_number_debug, PLUGIN_VAR_OPCMDARG, "An InnoDB page number.", NULL, innodb_save_page_no, 0, 0, UINT_MAX32, 0)
 
static MYSQL_SYSVAR_BOOL (page_cleaner_disabled_debug, innodb_page_cleaner_disabled_debug, PLUGIN_VAR_OPCMDARG, "Disable page cleaner", NULL, buf_flush_page_cleaner_disabled_debug_update, FALSE)
 
static MYSQL_SYSVAR_BOOL (dict_stats_disabled_debug, innodb_dict_stats_disabled_debug, PLUGIN_VAR_OPCMDARG, "Disable dict_stats thread", NULL, dict_stats_disabled_debug_update, FALSE)
 
static MYSQL_SYSVAR_BOOL (master_thread_disabled_debug, srv_master_thread_disabled_debug, PLUGIN_VAR_OPCMDARG, "Disable master thread", NULL, srv_master_thread_disabled_debug_update, FALSE)
 
static MYSQL_SYSVAR_BOOL (sync_debug, srv_sync_debug, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY, "Enable the sync debug checks", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_BOOL (buffer_pool_debug, srv_buf_pool_debug, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY, "Enable buffer pool debug", NULL, NULL, FALSE)
 
static MYSQL_SYSVAR_BOOL (ddl_log_crash_reset_debug, innodb_ddl_log_crash_reset_debug, PLUGIN_VAR_OPCMDARG, "Reset all crash injection counters to 1", NULL, ddl_log_crash_reset, FALSE)
 
static MYSQL_SYSVAR_STR (directories, innobase_directories, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY|PLUGIN_VAR_NOPERSIST, "List of directories 'dir1;dir2;..;dirN' to scan for " "tablespace files. Default is to scan " "'innodb-data-home-dir;innodb-undo-directory;datadir'", NULL, NULL, NULL)
 
 mysql_declare_plugin (innobase)
 
ICP_RESULT innobase_index_cond (ha_innobase *h)
 

Index Condition Pushdown interface implementation More...
 
void innobase_init_vc_templ (dict_table_t *table)
 Get the computed value by supplying the base column values. More...
 
void innobase_rename_vc_templ (dict_table_t *table)
 Change dbname and table name in table->vc_templ. More...
 
static dfield_tinnobase_get_field_from_update_vector (dict_foreign_t *foreign, upd_t *update, ulint col_no)
 Get the updated parent field value from the update vector for the given col_no. More...
 
dfield_tinnobase_get_computed_value (const dtuple_t *row, const dict_v_col_t *col, const dict_index_t *index, mem_heap_t **local_heap, mem_heap_t *heap, const dict_field_t *ifield, THD *thd, TABLE *mysql_table, const dict_table_t *old_table, upd_t *parent_update, dict_foreign_t *foreign)
 Get the computed value by supplying the base column values. More...
 
void ib_senderrf (THD *thd, ib_log_level_t level, ib_uint32_t code,...)
 Use this when the args are passed to the format string from errmsg-utf8.txt directly as is. More...
 
void ib_errf (THD *thd, ib_log_level_t level, ib_uint32_t code, const char *format,...)
 Use this when the args are first converted to a formatted string and then passed to the format string from errmsg-utf8.txt. More...
 
uint innobase_convert_to_filename_charset (char *to, const char *from, ulint len)
 
uint innobase_convert_to_system_charset (char *to, const char *from, ulint len, uint *errors)
 
void ib_warn_row_too_big (const dict_table_t *table)
 
static void innodb_fill_fake_column_struct (dict_col_t *col, const Ha_fk_column_type *fk_col_type)
 Constructs fake dict_col_t describing column for foreign key type compatibility check from column description in Ha_fk_column_type form. More...
 

Variables

static const size_t MOVED_FILES_PRINT_THRESHOLD = 32
 Stop printing warnings, if the count exceeds this threshold. More...
 
const mysql_service_registry_treg_svc = nullptr
 
my_h_service h_ret_sysvar_source_svc = nullptr
 
const mysql_service_system_variable_source_tsysvar_source_svc = nullptr
 
static const uint64_t KB = 1024
 
static const uint64_t MB = KB * 1024
 
static const uint64_t GB = MB * 1024
 
uint32_t predefined_flags
 fil_space_t::flags for hard-coded tablespaces More...
 
static mysql_mutex_t innobase_share_mutex
 to protect innobase_open_files More...
 
ib_mutex_t master_key_id_mutex
 
static ulong commit_threads = 0
 to force correct commit order in binlog More...
 
static mysql_cond_t commit_cond
 
static mysql_mutex_t commit_cond_m
 
mysql_cond_t resume_encryption_cond
 
mysql_mutex_t resume_encryption_cond_m
 
static bool innodb_inited = 0
 
static struct handlertoninnodb_hton_ptr
 
static const long AUTOINC_OLD_STYLE_LOCKING = 0
 
static const long AUTOINC_NEW_STYLE_LOCKING = 1
 
static const long AUTOINC_NO_LOCKING = 2
 
static long innobase_open_files
 
static long innobase_autoinc_lock_mode
 
static ulong innobase_commit_concurrency = 0
 
bool srv_buffer_pool_in_core_file = TRUE
 
thread_local ulint ut_rnd_ulint_counter
 
static uint innobase_old_blocks_pct
 Percentage of the buffer pool to reserve for 'old' blocks. More...
 
static char * innobase_data_home_dir = NULL
 
static char * innobase_data_file_path = NULL
 
static char * innobase_temp_data_file_path = NULL
 
static char * innobase_enable_monitor_counter = NULL
 
static char * innobase_disable_monitor_counter = NULL
 
static char * innobase_reset_monitor_counter = NULL
 
static char * innobase_reset_all_monitor_counter = NULL
 
char * innobase_directories = NULL
 
static ulong innodb_flush_method
 
static char * innobase_server_stopword_table = NULL
 
static bool innobase_use_doublewrite = TRUE
 
static bool innobase_rollback_on_timeout = FALSE
 
static bool innobase_create_status_file = FALSE
 
bool innobase_stats_on_metadata = TRUE
 
static bool innodb_optimize_fulltext_only = FALSE
 
static char * innodb_version_str = (char *)INNODB_VERSION_STR
 
static Innodb_data_lock_inspector innodb_data_lock_inspector
 
static ulong innodb_default_row_format = DEFAULT_ROW_FORMAT_DYNAMIC
 
static const char * innodb_debug_compress_names []
 Values for –innodb-debug-compress names. More...
 
static TYPELIB innodb_debug_compress_typelib
 Enumeration of –innodb-debug-compress. More...
 
static const char * innodb_stats_method_names []
 Possible values for system variable "innodb_stats_method". More...
 
static TYPELIB innodb_stats_method_typelib
 Used to define an enumerate type of the system variable innodb_stats_method. More...
 
static const char * innodb_checksum_algorithm_names []
 Possible values of the parameter innodb_checksum_algorithm. More...
 
static TYPELIB innodb_checksum_algorithm_typelib
 Used to define an enumerate type of the system variable innodb_checksum_algorithm. More...
 
static const char * innodb_flush_method_names []
 Names of allowed values of innodb_flush_method. More...
 
static TYPELIB innodb_flush_method_typelib
 Enumeration of innodb_flush_method. More...
 
static const char * innodb_default_row_format_names []
 Possible values for system variable "innodb_default_row_format". More...
 
static TYPELIB innodb_default_row_format_typelib
 Used to define an enumerate type of the system variable innodb_default_row_format. More...
 
static ulong innobase_active_counter = 0
 
static hash_table_tinnobase_open_tables
 
static std::vector< Plugin_tablespace::Plugin_tablespace_file *, ut_allocator< Plugin_tablespace::Plugin_tablespace_file * > > innobase_sys_files
 Array of data files of the system tablespace. More...
 
static const char * innodb_change_buffering_names []
 Allowed values of innodb_change_buffering. More...
 
static TYPELIB innodb_change_buffering_typelib
 Enumeration of innodb_change_buffering. More...
 
const struct _ft_vft ft_vft_result
 
const struct _ft_vft_ext ft_vft_ext_result
 
static mysql_pfs_key_t innobase_share_mutex_key
 
static mysql_pfs_key_t commit_cond_mutex_key
 
static mysql_pfs_key_t commit_cond_key
 
mysql_pfs_key_t resume_encryption_cond_mutex_key
 
mysql_pfs_key_t resume_encryption_cond_key
 
static PSI_mutex_info all_pthread_mutexes []
 
static PSI_cond_info all_innodb_conds []
 
static ib_cb_t innodb_api_cb []
 
static SHOW_VAR innodb_status_variables []
 
static const char * ha_innobase_exts [] = {dot_ext[IBD], NullS}
 Gives the file extension of an InnoDB single-table tablespace. More...
 
static const ulint MIN_EXPECTED_TABLESPACE_SIZE = 5 * 1024 * 1024
 Minimum expected tablespace size. More...
 
static ulong srv_fil_make_page_dirty_debug = 0
 
static ulong srv_saved_page_number_debug = 0
 
static char * srv_buffer_pool_evict
 
static bool innodb_background_drop_list_empty = TRUE
 
static bool innodb_purge_run_now = TRUE
 
static bool innodb_purge_stop_now = TRUE
 
static bool innodb_log_checkpoint_now = TRUE
 
static bool innodb_log_checkpoint_fuzzy_now = TRUE
 
static bool innodb_buf_flush_list_now = TRUE
 
static uint innodb_merge_threshold_set_all_debug
 
static bool innodb_buffer_pool_dump_now = FALSE
 
static bool innodb_buffer_pool_load_now = FALSE
 
static bool innodb_buffer_pool_load_abort = FALSE
 
static SHOW_VAR innodb_status_variables_export []
 
static struct st_mysql_storage_engine innobase_storage_engine
 
static SYS_VARinnobase_system_variables []
 
 i_s_innodb_trx
 
 i_s_innodb_cmp
 
 i_s_innodb_cmp_reset
 
 i_s_innodb_cmpmem
 
 i_s_innodb_cmpmem_reset
 
 i_s_innodb_cmp_per_index
 
 i_s_innodb_cmp_per_index_reset
 
 i_s_innodb_buffer_page
 
 i_s_innodb_buffer_page_lru
 
 i_s_innodb_buffer_stats
 
 i_s_innodb_temp_table_info
 
 i_s_innodb_metrics
 
 i_s_innodb_ft_default_stopword
 
 i_s_innodb_ft_deleted
 
 i_s_innodb_ft_being_deleted
 
 i_s_innodb_ft_config
 
 i_s_innodb_ft_index_cache
 
 i_s_innodb_ft_index_table
 
 i_s_innodb_tables
 
 i_s_innodb_tablestats
 
 i_s_innodb_indexes
 
 i_s_innodb_tablespaces
 
 i_s_innodb_columns
 
 i_s_innodb_virtual
 
 i_s_innodb_cached_indexes
 
i_s_innodb_session_temp_tablespaces mysql_declare_plugin_end
 
const char * TROUBLESHOOTING_MSG
 
const char * TROUBLESHOOT_DATADICT_MSG
 
const char * BUG_REPORT_MSG
 
const char * FORCE_RECOVERY_MSG
 
const char * ERROR_CREATING_MSG
 
const char * OPERATING_SYSTEM_ERROR_MSG
 
const char * FOREIGN_KEY_CONSTRAINTS_MSG
 
const char * INNODB_PARAMETERS_MSG
 

Macro Definition Documentation

◆ EQ_CURRENT_THD

#define EQ_CURRENT_THD (   thd)    ((thd) == current_thd)

◆ get_sys_mem

#define get_sys_mem   get_mem_sysconf

◆ INNOBASE_WAKE_INTERVAL

#define INNOBASE_WAKE_INTERVAL   32

◆ INNODB_API_CB_ARRAY_ELEMENT_TRANSFORM

#define INNODB_API_CB_ARRAY_ELEMENT_TRANSFORM (   stem)    (ib_cb_t) ib_##stem,

Set up InnoDB API callback function array.

◆ innodb_srv_buf_dump_filename_validate

#define innodb_srv_buf_dump_filename_validate   NULL

◆ misc_word_char

#define misc_word_char (   X)    0

◆ NAME_CHAR_LEN_PARTITIONS_STR

#define NAME_CHAR_LEN_PARTITIONS_STR   "199"

Maximum length of a table name from InnoDB point of view, including partitions and subpartitions, in number of characters.

The naming is: "table_name#P#partition_name#SP#subpartition_name", where each of the names can be up to NAME_CHAR_LEN (64) characters. So the maximum is 64 + strlen(P#) + 64 + strlen(#SP#) + 64 = 199.

◆ PSI_KEY

#define PSI_KEY (   n,
  flag,
  volatility,
  doc 
)    { &(n##_key.m_value), #n, flag, volatility, doc }

◆ PSI_MUTEX_KEY

#define PSI_MUTEX_KEY (   n,
  flag,
  volatility,
  doc 
)    { &(n##_key.m_value), #n, flag, volatility, doc }

◆ PSI_RWLOCK_KEY

#define PSI_RWLOCK_KEY (   n,
  volatility,
  doc 
)    { &n##_key.m_value, #n, PSI_FLAG_RWLOCK_SX, volatility, doc }

◆ true_word_char

#define true_word_char (   c,
  ch 
)    ((c) & (_MY_U | _MY_L | _MY_NMR) || (ch) == '_')

Enumeration Type Documentation

◆ default_row_format_enum

Note we cannot use rec_format_enum because we do not allow COMPRESSED row format for innodb_default_row_format option.

Enumerator
DEFAULT_ROW_FORMAT_REDUNDANT 
DEFAULT_ROW_FORMAT_COMPACT 
DEFAULT_ROW_FORMAT_DYNAMIC 

Function Documentation

◆ acquire_sysvar_source_service()

static void acquire_sysvar_source_service ( )
static

◆ add_table_to_thread_cache()

static void add_table_to_thread_cache ( dict_table_t table,
mem_heap_t heap,
THD thd 
)
inlinestatic

Add the table handler to thread cache.

Obtain the InnoDB transaction of a MySQL thread.

Parameters
[in,out]tabletable handler
[in,out]heapheap for allocating system columns.
[in,out]thdMySQL thread handler

◆ apply_dd_undo_state()

bool apply_dd_undo_state ( space_id_t  space_id,
const dd::Tablespace dd_space 
)

Save the state of undo tablespaces from the dd to the undo::Tablespace.

Parameters
[in]space_idtablespace ID
[in]dd_spacedd::Tablespace object
Returns
true if success and falso if the undo tablespace state is not saved.

◆ boot_tablespaces()

static bool boot_tablespaces ( THD thd,
size_t *  moved_count 
)
static

Discover all InnoDB tablespaces.

Parameters
[in,out]thdthread handle
[out]moved_countNumber of files that have been moved
Return values
trueon error
falseon success

◆ buf_flush_list_now_set()

static void buf_flush_list_now_set ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Force a dirty pages flush now.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ buffer_pool_dump_now()

static void buffer_pool_dump_now ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Trigger a dump of the buffer pool if innodb_buffer_pool_dump_now is set to ON.

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ buffer_pool_load_abort()

static void buffer_pool_load_abort ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Abort a load of the buffer pool if innodb_buffer_pool_load_abort is set to ON.

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ buffer_pool_load_now()

static void buffer_pool_load_now ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Trigger a load of the buffer pool if innodb_buffer_pool_load_now is set to ON.

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ build_template_field()

static mysql_row_templ_t* build_template_field ( row_prebuilt_t prebuilt,
dict_index_t clust_index,
dict_index_t index,
TABLE table,
const Field field,
ulint  i,
ulint  v_no 
)
static

Adds a field to a m_prebuilt struct 'template'.

Returns
the field template
Parameters
prebuiltin/out: template
clust_indexin: InnoDB clustered index
indexin: InnoDB index to use
tablein: MySQL table object
fieldin: field in MySQL table
iin: field index in InnoDB table
v_noin: field index for virtual col

◆ build_template_needs_field()

static const Field* build_template_needs_field ( ibool  index_contains,
ibool  read_just_key,
ibool  fetch_all_in_key,
ibool  fetch_primary_key_cols,
dict_index_t index,
const TABLE table,
ulint  i,
ulint  num_v 
)
static

Determines if a field is needed in a m_prebuilt struct 'template'.

Returns
field to use, or NULL if the field is not needed
Parameters
index_containsin: dict_index_contains_col_or_prefix( index, i)
read_just_keyin: TRUE when MySQL calls ha_innobase::extra with the argument HA_EXTRA_KEYREAD; it is enough to read just columns defined in the index (i.e., no read of the clustered index record necessary)
fetch_all_in_keyin: true=fetch all fields in the index
fetch_primary_key_colsin: true=fetch the primary key columns
indexin: InnoDB index to use
tablein: MySQL table object
iin: field index in InnoDB table
num_vin: num virtual column so far

◆ build_template_needs_field_in_icp()

bool build_template_needs_field_in_icp ( const dict_index_t index,
const row_prebuilt_t prebuilt,
bool  contains,
ulint  i,
bool  is_virtual 
)
inline

Determines if a field is needed in a m_prebuilt struct 'template'.

Returns
whether the field is needed for index condition pushdown
Parameters
indexin: InnoDB index
prebuiltin: row fetch template
containsin: whether the index contains column i
iin: column number
is_virtualin: a virtual column or not

◆ calc_row_difference()

static dberr_t calc_row_difference ( upd_t uvect,
const uchar old_row,
uchar new_row,
TABLE table,
uchar upd_buff,
ulint  buff_len,
row_prebuilt_t prebuilt,
THD thd 
)
static

Checks which fields have changed in a row and stores information of them to an update vector.

Returns
DB_SUCCESS or error code
Parameters
uvectin/out: update vector
old_rowin: old row in MySQL format
new_rowin: new row in MySQL format
tablein: table in MySQL data dictionary
upd_buffin: buffer to use
buff_lenin: buffer length
prebuiltin: InnoDB prebuilt struct
thdin: user thread

◆ calculate_delete_length_stat()

static void calculate_delete_length_stat ( const dict_table_t ib_table,
ha_statistics stats,
THD thd 
)
static

Calculate delete length statistic.

Parameters
[in]ib_tabletable object
[in,out]statsstats structure to hold calculated values
[in,out]thduser thread handle (for issuing warnings)

◆ calculate_index_size_stats()

static void calculate_index_size_stats ( const dict_table_t ib_table,
ib_uint64_t  n_rows,
ulint  stat_clustered_index_size,
ulint  stat_sum_of_other_index_sizes,
ha_statistics stats 
)
static

Calculate stats based on index size.

Parameters
[in]ib_tabletable object
[in]n_rowsnumber of rows
[in]stat_clustered_index_sizeclustered index size
[in]stat_sum_of_other_index_sizessum of non-clustered indexes size
[in,out]statsthe stats structure to hold calculated values

◆ check_func_bool()

int check_func_bool ( THD ,
SYS_VAR ,
void *  save,
st_mysql_value value 
)

◆ check_trx_exists()

trx_t* check_trx_exists ( THD thd)

Gets the InnoDB transaction handle for a MySQL handler object, creates an InnoDB transaction struct if the corresponding MySQL thread struct still lacks one.

Returns
InnoDB transaction handle
Parameters
thdin: user thread handle

◆ checkpoint_disabled_update()

static void checkpoint_disabled_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Updates srv_checkpoint_disabled - allowing or disallowing checkpoints.

This is called when user invokes SET GLOBAL innodb_checkpoints_disabled=0/1. After checkpoints are disabled, there will be no write of a checkpoint, until checkpoints are re-enabled (log_sys->checkpointer_mutex protects that)

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ checkpoint_fuzzy_now_set()

static void checkpoint_fuzzy_now_set ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Force InnoDB to do fuzzy checkpoint.

Fuzzy checkpoint does not force InnoDB to flush dirty pages. It only forces to write the new checkpoint_lsn to the header of ib_logfile0. This LSN is where the recovery starts. You can read more about the fuzzy checkpoints in the internet.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ checkpoint_now_set()

static void checkpoint_now_set ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Force InnoDB to do sharp checkpoint.

This forces a flush of all dirty pages.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ convert_error_code_to_mysql()

int convert_error_code_to_mysql ( dberr_t  error,
uint32_t  flags,
THD thd 
)

Converts an InnoDB error code to a MySQL error code and also tells to MySQL about a possible transaction rollback inside InnoDB caused by a lock wait timeout or a deadlock.

Converts an InnoDB error code to a MySQL error code.

Parameters
[in]errorInnoDB error code
[in]flagsInnoDB table flags, or 0
[in]thduser thread handle or NULL
Returns
MySQL error code

◆ convert_search_mode_to_innobase()

page_cur_mode_t convert_search_mode_to_innobase ( ha_rkey_function  find_flag)

Converts a search mode flag understood by MySQL to a flag understood by InnoDB.

◆ create_clustered_index_when_no_primary()

int create_clustered_index_when_no_primary ( trx_t trx,
uint32_t  flags,
const char *  table_name 
)
inline

Creates an index to an InnoDB table when the user has defined no primary index.

Parameters
trxin: InnoDB transaction handle
flagsin: InnoDB table flags
table_namein: table name

◆ create_index()

int create_index ( trx_t trx,
const TABLE form,
uint32_t  flags,
const char *  table_name,
uint  key_num,
const dd::Table dd_table 
)
inline

Creates an index in an InnoDB database.

Parameters
trxin: InnoDB transaction handle
formin: information on table columns and indexes
flagsin: InnoDB table flags
table_namein: table name
key_numin: index number
dd_tablein: dd::Table for the table

◆ create_table_info_t::create_table_update_global_dd< dd::Partition >()

◆ create_table_info_t::create_table_update_global_dd< dd::Table >()

◆ dd_create_hardcoded()

static bool dd_create_hardcoded ( space_id_t  space_id,
const char *  filename 
)
static

Create a hard-coded tablespace file at server initialization.

Parameters
[in]space_idfil_space_t::id
[in]filenamefile name
Return values
falseon success
trueon failure

◆ dd_is_only_column()

static bool dd_is_only_column ( const dd::Index index,
const dd::Column column 
)
static

Check if a column is the only column in an index.

Parameters
[in]indexdata dictionary index
[in]columnthe column to look for
Returns
whether the column is the only column in the index

◆ dd_open_hardcoded()

static bool dd_open_hardcoded ( space_id_t  space_id,
const char *  filename 
)
static

Open a hard-coded tablespace file at server initialization.

Parameters
[in]space_idfil_space_t::id
[in]filenamefile name
Return values
falseon success
trueon failure

◆ free_share()

static void free_share ( INNOBASE_SHARE share)
static

Free the shared object that was registered with get_share().

in/own: share to free

Parameters
sharein/own: table share to free

◆ get_field_offset()

static uint get_field_offset ( const TABLE table,
const Field field 
)
inlinestatic

Gets field offset for a field in a table.

Parameters
[in]tableMySQL table object
[in]fieldMySQL field object
Returns
offset

◆ get_foreign_key_info()

static FOREIGN_KEY_INFO* get_foreign_key_info ( THD thd,
dict_foreign_t foreign 
)
static

Maps a InnoDB foreign key constraint to a equivalent MySQL foreign key info.

Returns
pointer to foreign key info
Parameters
thdin: user thread handle
foreignin: foreign key constraint

◆ get_innobase_type_from_mysql_dd_type()

ulint get_innobase_type_from_mysql_dd_type ( ulint *  unsigned_flag,
ulint *  binary_type,
ulint *  charset_no,
dd::enum_column_types  dd_type,
const CHARSET_INFO field_charset,
bool  is_unsigned 
)

Converts a MySQL data-dictionary type to an InnoDB type.

Also returns a few attributes which are useful for precise type calculation.

Note
This function is version of get_innobase_type_from_mysql_type() with added knowledge about how additional attributes calculated (e.g. in create_table_info_t::create_table_def()) and about behavior of Field class and its descendats.
It allows to get InnoDB generic and precise types directly from MySQL data-dictionary info, bypassing expensive construction of Field objects.
Parameters
[out]unsigned_flagDATA_UNSIGNED if an 'unsigned type'.
[out]binary_typeDATA_BINARY_TYPE if a 'binary type'.
[out]charset_noCollation id for string types.
[in]dd_typeMySQL data-dictionary type.
[in]field_charsetCharset.
[in]is_unsignedMySQL data-dictionary unsigned flag.
Returns
DATA_BINARY, DATA_VARCHAR, ...

◆ get_innobase_type_from_mysql_type()

ulint get_innobase_type_from_mysql_type ( ulint *  unsigned_flag,
const void *  f 
)

Converts a MySQL type to an InnoDB type.

Note that this function returns the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1 VARCHAR and the new true VARCHAR in >= 5.0.3 by the 'prtype'.

Parameters
[out]unsigned_flagDATA_UNSIGNED if an 'unsigned type'; at least ENUM and SET, and unsigned integer types are 'unsigned types'
[in]fMySQL Field
Returns
DATA_BINARY, DATA_VARCHAR, ...

◆ get_mem_sysconf()

static double get_mem_sysconf ( )
static

◆ get_my_dd_index()

template<typename Index >
const dd::Index* get_my_dd_index ( const Index *  index)

◆ get_my_dd_index< dd::Index >()

template<>
const dd::Index* get_my_dd_index< dd::Index > ( const dd::Index dd_index)

◆ get_my_dd_index< dd::Partition_index >()

template<>
const dd::Index* get_my_dd_index< dd::Partition_index > ( const dd::Partition_index dd_index)

◆ get_row_format()

static rec_format_t get_row_format ( ulong  row_format)
static

Return the InnoDB ROW_FORMAT enum value.

Parameters
[in]row_formatrow_format from "innodb_default_row_format"
Returns
InnoDB ROW_FORMAT value from rec_format_t enum.

◆ get_share()

static INNOBASE_SHARE * get_share ( const char *  table_name)
static

Handling the shared INNOBASE_SHARE structure that is needed to provide table locking.

Register the table name if it doesn't exist in the hash table. in: table to lookup

Register the table name if it doesn't exist in the hash table.

◆ get_table_name_info()

static void get_table_name_info ( THD thd,
st_handler_tablename f_key_info,
const dict_foreign_t foreign 
)
static

Get the table name and database name for the given table.

Parameters
[in,out]thduser thread handle
[out]f_key_infopointer to table_name_info object
[in]foreignforeign key constraint.

◆ get_zip_shift_size()

static ulint get_zip_shift_size ( ulint  key_block_size)
static

** InnoDB database tables

The requested compressed page size (key_block_size) is given in kilobytes. If it is a valid number, store that value as the number of log2 shifts from 512 in zip_ssize. Zero means it is not compressed.

◆ ib_errf()

void ib_errf ( THD thd,
ib_log_level_t  level,
ib_uint32_t  code,
const char *  format,
  ... 
)

Use this when the args are first converted to a formatted string and then passed to the format string from errmsg-utf8.txt.

The error message format must be: "Some string ... %s".

Push a warning message to the client, it is a wrapper around:

void push_warning_printf( THD *thd, Sql_condition::enum_condition_level level, uint code, const char *format, ...);

Parameters
thdin/out: session
levelin: warning level
codeMySQL error code
formatprintf format

◆ ib_senderrf()

void ib_senderrf ( THD thd,
ib_log_level_t  level,
ib_uint32_t  code,
  ... 
)

Use this when the args are passed to the format string from errmsg-utf8.txt directly as is.

Push a warning message to the client, it is a wrapper around:

void push_warning_printf( THD *thd, Sql_condition::enum_condition_level level, uint code, const char *format, ...);

Parameters
thdin/out: session
levelin: warning level
codeMySQL error code

◆ ib_warn_row_too_big()

void ib_warn_row_too_big ( const dict_table_t table)

◆ index_pct_cached()

double index_pct_cached ( const dict_index_t index)
inline

Estimate what percentage of an index's pages are cached in the buffer pool.

Parameters
[in]indexindex whose pages to look up
Returns
a real number in [0.0, 1.0] designating the percentage of cached pages

◆ innobase_active_small()

void innobase_active_small ( void  )
inline

Increments innobase_active_counter and every INNOBASE_WAKE_INTERVALth time calls srv_active_wake_master_thread.

This function should be used when a single database operation may introduce a small need for server utility activity, like checkpointing.

◆ innobase_alter_encrypt_tablespace()

static int innobase_alter_encrypt_tablespace ( handlerton hton,
THD thd,
st_alter_tablespace alter_info,
const dd::Tablespace old_dd_space,
dd::Tablespace new_dd_space 
)
static

Alter Encrypt/Unencrypt a tablespace.

Parameters
[in]htonHandlerton of InnoDB
[in]thdConnection
[in]alter_infoHow to do the command
[in]old_dd_spaceTablespace metadata
[in,out]new_dd_spaceTablespace metadata
Returns
MySQL error code

◆ innobase_alter_tablespace()

static int innobase_alter_tablespace ( handlerton hton,
THD thd,
st_alter_tablespace alter_info,
const dd::Tablespace old_ts_def,
dd::Tablespace new_ts_def 
)
static

This API handles CREATE, ALTER & DROP commands for InnoDB tablespaces.

Parameters
[in]htonHandlerton of InnoDB
[in]thdConnection
[in]alter_infoDescribes the command and how to do it.
[in]old_ts_defOld version of dd::Tablespace object for the tablespace.
[in,out]new_ts_defNew version of dd::Tablespace object for the tablespace. Can be adjusted by SE. Changes will be persisted in the data-dictionary at statement commit.
Returns
MySQL error code
Parameters
[in]htonHandlerton of InnoDB
[in]thdConnection
[in]alter_infoHow to do the command
[in]old_ts_defOld version of dd::Tablespace object for the tablespace
[in,out]new_ts_defNew version of dd::Tablespace object for the tablespace. Can be adjusted by SE. Changes will be persisted in the data-dictionary at statement commit.
Returns
MySQL error code

◆ innobase_basename()

const char* innobase_basename ( const char *  path_name)

Strip dir name from a full path name and return only the file name.

Parameters
[in]path_namefull path name
Returns
file name or "null" if no file name

◆ innobase_basic_ddl::create_impl< dd::Partition >()

template int innobase_basic_ddl::create_impl< dd::Partition > ( THD ,
const char *  ,
TABLE ,
HA_CREATE_INFO ,
dd::Partition ,
bool  ,
bool  ,
bool  ,
ulint  ,
ulint   
)

◆ innobase_basic_ddl::create_impl< dd::Table >()

template int innobase_basic_ddl::create_impl< dd::Table > ( THD ,
const char *  ,
TABLE ,
HA_CREATE_INFO ,
dd::Table ,
bool  ,
bool  ,
bool  ,
ulint  ,
ulint   
)

◆ innobase_basic_ddl::delete_impl< dd::Partition >()

template int innobase_basic_ddl::delete_impl< dd::Partition > ( THD ,
const char *  ,
const dd::Partition  
)

◆ innobase_basic_ddl::delete_impl< dd::Table >()

template int innobase_basic_ddl::delete_impl< dd::Table > ( THD ,
const char *  ,
const dd::Table  
)

◆ innobase_basic_ddl::rename_impl< dd::Partition >()

template int innobase_basic_ddl::rename_impl< dd::Partition > ( THD ,
const char *  ,
const char *  ,
const dd::Partition ,
const dd::Partition  
)

◆ innobase_basic_ddl::rename_impl< dd::Table >()

template int innobase_basic_ddl::rename_impl< dd::Table > ( THD ,
const char *  ,
const char *  ,
const dd::Table ,
const dd::Table  
)

◆ innobase_build_index_translation()

static bool innobase_build_index_translation ( const TABLE table,
dict_table_t ib_table,
INNOBASE_SHARE share 
)
static

This function builds a translation table in INNOBASE_SHARE structure for fast index location with mysql array number from its table->key_info structure.

This also provides the necessary translation between the key order in mysql key_info and InnoDB ib_table->indexes if they are not fully matched with each other. Note we do not have any mutex protecting the translation table building based on the assumption that there is no concurrent index creation/drop and DMLs that requires index lookup. All table handle will be closed before the index creation/drop.

Returns
true if index translation table built successfully
Parameters
tablein: table in MySQL data dictionary
ib_tablein: table in InnoDB data dictionary
sharein/out: share structure where index translation table will be constructed in.

◆ innobase_build_v_templ()

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.

Parameters
[in]tableMySQL TABLE
[in]ib_tableInnoDB dict_table_t
[in,out]s_templInnoDB template structure
[in]add_vnew virtual columns added along with add index call
[in]lockedtrue if dict_sys mutex is held
[in]share_tbl_nameoriginal MySQL table name

◆ innobase_build_v_templ_callback()

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

callback used by MySQL server layer to initialized the table virtual columns' template

Parameters
[in]tableMySQL TABLE
[in,out]ib_tableInnoDB table

◆ innobase_casedn_path()

void innobase_casedn_path ( char *  a)

Makes all characters in a NUL-terminated UTF-8 path string lower case.

Parameters
ain/out: string to put in lower case

◆ innobase_casedn_str()

void innobase_casedn_str ( char *  a)

Makes all characters in a NUL-terminated UTF-8 string lower case.

Parameters
ain/out: string to put in lower case

◆ innobase_check_fk_base_col()

static dberr_t innobase_check_fk_base_col ( const dd::Table dd_table,
const TABLE table 
)
static

Check any cascading foreign key columns are base columns for any stored columns in the table.

Parameters
[in]dd_tabledd::Table for the table
[in]tableTABLE* for the table
Returns
DB_NO_FK_ON_S_BASE_COL if found or DB_SUCCESS

◆ innobase_check_identifier_length()

bool innobase_check_identifier_length ( const char *  id)

◆ innobase_check_reserved_file_name()

static bool innobase_check_reserved_file_name ( handlerton hton,
const char *  name 
)
static

Checks if the filename name is reserved in InnoDB.

Checks if the file name is reserved in InnoDB.

Returns
true if the name is reserved in: Name of the database

Currently redo log files(ib_logfile*) is reserved.

Parameters
[in]htonHandlerton of InnoDB.
[in]nameName of the database.
Return values
trueName is reserved.
falseName is not reserved.
Parameters
htonin: handlerton of Innodb
namein: Name of the database

◆ innobase_close_connection()

static int innobase_close_connection ( handlerton hton,
THD thd 
)
static

Frees a possible InnoDB trx object associated with the current THD.

Returns
0 or error number in: MySQL thread handle for which to close the connection
0 or error number
Parameters
htonin/out: InnoDB handlerton
thdin: handle to the MySQL thread of the user whose resources should be free'd

◆ innobase_collect_hton_log_info()

static bool innobase_collect_hton_log_info ( handlerton hton,
Json_dom json 
)
static

Implements Log_resource collect_info.

Parameters
[in]htonthe innodb handlerton
[in]jsonthe JSON dom to receive the log info
Returns
false on success

◆ innobase_commit()

static int innobase_commit ( handlerton hton,
THD thd,
bool  commit_trx 
)
static

Commits a transaction in an InnoDB database or marks an SQL statement ended.

Returns
0 in: true - commit transaction false - the current SQL statement ended
0 or deadlock error if the transaction was aborted by another higher priority transaction.
Parameters
htonin/out: InnoDB handlerton
thdin: MySQL thread handle of the user for whom the transaction should be committed
commit_trxin: true - commit transaction false - the current SQL statement ended

◆ innobase_commit_by_xid()

static xa_status_code innobase_commit_by_xid ( handlerton hton,
XID xid 
)
static

This function is used to commit one X/Open XA distributed transaction which is in the prepared state.

Returns
0 or error number in: X/Open XA transaction identification
0 or error number
Parameters
htonin: InnoDB handlerton
xidin: X/Open XA transaction identification

◆ innobase_commit_concurrency_init_default()

static void innobase_commit_concurrency_init_default ( )
static

Initialize the default value of innodb_commit_concurrency.

Once InnoDB is running, the innodb_commit_concurrency must not change from zero to nonzero. (Bug #42101)

The initial default value is 0, and without this extra initialization, SET GLOBAL innodb_commit_concurrency=DEFAULT would set the parameter to 0, even if it was initially set to nonzero at the command line or configuration file.

◆ innobase_commit_concurrency_validate()

static int innobase_commit_concurrency_validate ( THD thd,
SYS_VAR var,
void *  save,
struct st_mysql_value value 
)
static

Check for a valid value of innobase_commit_concurrency.

Returns
0 for valid innodb_commit_concurrency
Parameters
thdin: thread handle
varin: pointer to system variable
saveout: immediate result for update function
valuein: incoming string

◆ innobase_commit_low()

void innobase_commit_low ( trx_t trx)

Commits a transaction in an InnoDB database.

Parameters
trxin: transaction handle

◆ innobase_convert_from_id()

void innobase_convert_from_id ( const CHARSET_INFO cs,
char *  to,
const char *  from,
ulint  len 
)

Converts an identifier to UTF-8.

Parameters
csin: the 'from' character set
toout: converted identifier
fromin: identifier to convert
lenin: length of 'to', in bytes

◆ innobase_convert_from_table_id()

void innobase_convert_from_table_id ( const CHARSET_INFO cs,
char *  to,
const char *  from,
ulint  len 
)

Converts an identifier to a table name.

Parameters
csin: the 'from' character set
toout: converted identifier
fromin: identifier to convert
lenin: length of 'to', in bytes

◆ innobase_convert_identifier()

static char* innobase_convert_identifier ( char *  buf,
ulint  buflen,
const char *  id,
ulint  idlen,
THD thd 
)
static

Convert a table name to the MySQL system_charset_info (UTF-8) and quote it.

Parameters
[out]bufbuffer for converted identifier
[in]buflenlength of buf, in bytes
[in]ididentifier to convert
[in]idlenlength of id, in bytes
[in]thdMySQL connection thread, or NULL
Returns
pointer to the end of buf

◆ innobase_convert_name()

char* innobase_convert_name ( char *  buf,
ulint  buflen,
const char *  id,
ulint  idlen,
THD thd 
)

Convert a table name to the MySQL system_charset_info (UTF-8).

Returns
pointer to the end of buf
Parameters
bufout: buffer for converted identifier
buflenin: length of buf, in bytes
idin: table name to convert
idlenin: length of id, in bytes
thdin: MySQL connection thread, or NULL

◆ innobase_convert_string()

static ulint innobase_convert_string ( void *  to,
ulint  to_length,
CHARSET_INFO to_cs,
const void *  from,
ulint  from_length,
CHARSET_INFO from_cs,
uint errors 
)
static

Wrapper around MySQL's copy_and_convert function.

Returns
number of bytes copied to 'to'
Parameters
toout: converted string
to_lengthin: number of bytes reserved for the converted string
to_csin: character set to convert to
fromin: string to convert
from_lengthin: number of bytes to convert
from_csin: character set to convert from
errorsout: number of errors encountered during the conversion

◆ innobase_convert_to_filename_charset()

uint innobase_convert_to_filename_charset ( char *  to,
const char *  from,
ulint  len 
)

◆ innobase_convert_to_system_charset()

uint innobase_convert_to_system_charset ( char *  to,
const char *  from,
ulint  len,
uint errors 
)

◆ innobase_copy_frm_flags_from_create_info()

static void innobase_copy_frm_flags_from_create_info ( dict_table_t innodb_table,
const HA_CREATE_INFO create_info 
)
static

Copy table flags from MySQL's HA_CREATE_INFO 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.

Parameters
innodb_tablein/out: InnoDB table
create_infoin: create info

◆ innobase_copy_frm_flags_from_table_share()

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.



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.

Parameters
innodb_tablein/out: InnoDB table
table_sharein: table share

◆ innobase_create_handler()

static handler * innobase_create_handler ( handlerton hton,
TABLE_SHARE table,
bool  partitioned,
MEM_ROOT mem_root 
)
static

Function for constructing an InnoDB table handler instance.

Parameters
[in,out]htonhandlerton for InnoDB
[in]tableMySQL table
[in]partitionedIndicates whether table is partitioned
[in]mem_rootmemory context

◆ innobase_ddse_dict_init()

static bool innobase_ddse_dict_init ( dict_init_mode_t  dict_init_mode,
uint  version,
List< const dd::Object_table > *  tables,
List< const Plugin_tablespace > *  tablespaces 
)
static

Initialize InnoDB for being used to store the DD tables.

Create the required files according to the dict_init_mode. Create strings representing the required DDSE tables, i.e., tables that InnoDB expects to exist in the DD, and add them to the appropriate out parameter.

Parameters
[in]dict_init_modeHow to initialize files
[in]versionTarget DD version if a new server is being installed. 0 if restarting an existing server.
[out]tablesList of SQL DDL statements for creating DD tables that are needed by the DDSE.
[out]tablespacesList of meta data for predefined tablespaces created by the DDSE.
Return values
trueAn error occurred.
falseSuccess - no errors.

◆ innobase_deadlock_detect_update()

static void innobase_deadlock_detect_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innobase_deadlock_detect using the "saved" value.

Makes sure to "wake up" the dedicated deadlock detector thread if needed. This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes (ignored)
[in]saveimmediate result from check function

◆ innobase_dict_cache_reset()

static void innobase_dict_cache_reset ( const char *  schema_name,
const char *  table_name 
)
static

Invalidate an entry or entries for partitoined table from the dict cache.

Parameters
[in]schema_nameSchema name
[in]table_nameTable name

◆ innobase_dict_cache_reset_tables_and_tablespaces()

static void innobase_dict_cache_reset_tables_and_tablespaces ( )
static

Invalidate user table dict cache after Replication Plugin recovers.

Table definition could be different with XA commit/rollback of DDL operations

◆ innobase_dict_get_server_version()

static bool innobase_dict_get_server_version ( uint version)
static

Get the server version id stored in the header of the dictionary tablespace.

Parameters
[out]versionVersion number from the DD tablespace header.
Return values
Operationoutcome, false if no error, otherwise true.

◆ innobase_dict_recover()

static bool innobase_dict_recover ( dict_recovery_mode_t  dict_recovery_mode,
uint  version 
)
static

Perform high-level recovery in InnoDB as part of initializing the data dictionary.

Parameters
[in]dict_recovery_modeHow to do recovery
[in]versionTarget DD version if a new server is being installed. Actual DD version if restarting an existing server.
Return values
trueAn error occurred.
falseSuccess - no errors.

◆ innobase_dict_register_dd_table_id()

static void innobase_dict_register_dd_table_id ( dd::Object_id  dd_table_id)
static

Initialize the set of hard coded DD table ids.

Parameters
[in]dd_table_idTable id of DD table.

◆ innobase_dict_set_server_version()

static bool innobase_dict_set_server_version ( )
static

Store the current server version number into the header of the dictionary tablespace.

Return values
Operationoutcome, false if no error, otherwise true.

◆ innobase_disable_core_dump()

void innobase_disable_core_dump ( )

Make sure that core file will not be generated, as generating a core file might violate our promise to not dump buffer pool data, and/or might dump not the expected memory pages due to failure in using madvise.

◆ innobase_encryption_key_rotation()

bool innobase_encryption_key_rotation ( )

Rotate the encrypted tablespace keys according to master key rotation.

Returns
false on success, true on failure

◆ innobase_fill_i_s_table()

static int innobase_fill_i_s_table ( handlerton ,
THD thd,
TABLE_LIST tables,
Item ,
enum_schema_tables  idx 
)
static

Fill handlerton based INFORMATION_SCHEMA tables.

Parameters
[in]-(unused) Handle to the handlerton structure
[in]thdThread/connection descriptor
[in,out]tablesInformation Schema tables to fill
[in]-(unused) Intended for conditional pushdown
[in]idxTable id that indicates which I_S table to fill
Returns
Operation status

InnoDB does not implement I_S.TABLESPACES

◆ innobase_flush_logs()

static bool innobase_flush_logs ( handlerton hton,
bool  binlog_group_flush 
)
static

Flush InnoDB redo logs to the file system.

Parameters
[in]htonInnoDB handlerton
[in]binlog_group_flushtrue if we got invoked by binlog group commit during flush stage, false in other cases.
Returns
false

◆ innobase_format_name()

void innobase_format_name ( char *  buf,
ulint  buflen,
const char *  name 
)

A wrapper function of innobase_convert_name(), convert a table name to the MySQL system_charset_info (UTF-8) and quote it if needed.

Returns
pointer to the end of buf
Parameters
bufout: buffer for converted identifier
buflenin: length of buf, in bytes
namein: table name to format

◆ innobase_fts_casedn_str()

size_t innobase_fts_casedn_str ( CHARSET_INFO cs,
char *  src,
size_t  src_len,
char *  dst,
size_t  dst_len 
)

Makes all characters in a string lower case.

Parameters
csin: Character set
srcin: string to put in lower case
src_lenin: input string length
dstin: buffer for result string
dst_lenin: buffer size

◆ innobase_fts_close_ranking()

static void innobase_fts_close_ranking ( FT_INFO fts_hdl)
static

Free the memory for the FTS handler.

Parameters
[in,out]fts_hdlFTS handler

◆ innobase_fts_count_matches()

static ulonglong innobase_fts_count_matches ( FT_INFO_EXT fts_hdl)
static

Find and retrieve the size of the current result.

Parameters
[in,out]fts_hdlFTS handler
Returns
number of matching rows
Parameters
fts_hdlin: FTS handler

◆ innobase_fts_create_doc_id_key()

static void innobase_fts_create_doc_id_key ( dtuple_t tuple,
const dict_index_t index,
doc_id_t doc_id 
)
static

Set up search tuple for a query through FTS_DOC_ID_INDEX on supplied Doc ID.

This is used by MySQL to retrieve the documents once the search result (Doc IDs) is available

◆ innobase_fts_find_ranking()

static float innobase_fts_find_ranking ( FT_INFO fts_hdl,
uchar ,
uint   
)
static

Find and Retrieve the FTS Relevance Ranking result for doc with doc_id of m_prebuilt->fts_doc_id.

Parameters
[in,out]fts_hdlFTS handler
Returns
the relevance ranking value

◆ innobase_fts_flags()

static ulonglong innobase_fts_flags ( )
static
Returns
Which part of the extended FTS API is supported

◆ innobase_fts_get_version()

static uint innobase_fts_get_version ( )
static
Returns
version of the extended FTS API

◆ innobase_fts_load_stopword()

ibool innobase_fts_load_stopword ( dict_table_t table,
trx_t trx,
THD thd 
)

Initialize the table FTS stopword list.


Initialize the table FTS stopword list

Returns
true if success
Parameters
tablein: Table has the FTS
trxin: transaction
thdin: current thread

◆ innobase_fts_retrieve_docid()

static ulonglong innobase_fts_retrieve_docid ( FT_INFO_EXT fts_hdl)
static

Find and Retrieve the FTS doc_id for the current result row.

Parameters
[in,out]fts_hdlFTS handler
Returns
the document ID

◆ innobase_fts_retrieve_ranking()

static float innobase_fts_retrieve_ranking ( FT_INFO fts_hdl)
static

Retrieve the FTS Relevance Ranking result for doc with doc_id of m_prebuilt->fts_doc_id.

Parameters
[in,out]fts_hdlFTS handler
Returns
the relevance ranking value

◆ innobase_fts_store_docid()

static void innobase_fts_store_docid ( TABLE tbl,
ulonglong  doc_id 
)
static

Store doc_id value into FTS_DOC_ID field.

Parameters
[in,out]tbltable containing FULLTEXT index
[in]doc_idFTS_DOC_ID value

◆ innobase_fts_text_case_cmp()

int innobase_fts_text_case_cmp ( const void *  cs,
const void *  p1,
const void *  p2 
)

compare two character string case insensitively according to their charset.

in: node

Parameters
csin: Character set
p1in: key
p2in: node

◆ innobase_fts_text_cmp()

int innobase_fts_text_cmp ( const void *  cs,
const void *  p1,
const void *  p2 
)

compare two character string according to their charset.

Parameters
csin: Character set
p1in: key
p2in: node

◆ innobase_fts_text_cmp_prefix()

int innobase_fts_text_cmp_prefix ( const void *  cs,
const void *  p1,
const void *  p2 
)

compare two character string according to their charset.

Parameters
csin: Character set
p1in: prefix key
p2in: value to compare

◆ innobase_get_at_most_n_mbchars()

ulint innobase_get_at_most_n_mbchars ( ulint  charset_id,
ulint  prefix_len,
ulint  data_len,
const char *  str 
)

This function is used to find the storage length in bytes of the first n characters for prefix indexes using a multibyte character set.

The function finds charset information and returns length of prefix_len characters in the index field in bytes.

Returns
number of bytes occupied by the first n characters

< character length in bytes

< number of characters in prefix
< charset used in the field

Parameters
charset_idin: character set id
prefix_lenin: prefix length in bytes of the index (this has to be divided by mbmaxlen to get the number of CHARACTERS n in the prefix)
data_lenin: length of the string in bytes
strin: character string

◆ innobase_get_charset()

const CHARSET_INFO* innobase_get_charset ( THD mysql_thd)

Determines the connection character set.

Returns
connection character set
Parameters
mysql_thdin: MySQL thread handle

◆ innobase_get_computed_value()

dfield_t* innobase_get_computed_value ( const dtuple_t row,
const dict_v_col_t col,
const dict_index_t index,
mem_heap_t **  local_heap,
mem_heap_t heap,
const dict_field_t ifield,
THD thd,
TABLE mysql_table,
const dict_table_t old_table,
upd_t parent_update,
dict_foreign_t foreign 
)

Get the computed value by supplying the base column values.

Parameters
[in,out]rowthe data row
[in]colvirtual column
[in]indexindex
[in,out]local_heapheap memory for processing large data etc.
[in,out]heapmemory heap that copies the actual index row
[in]ifieldindex field
[in]thdMySQL thread handle
[in,out]mysql_tablemysql table object
[in]old_tableduring ALTER TABLE, this is the old table or NULL.
[in]parent_updateupdate vector for the parent row
[in]foreignforeign key information
Returns
the field filled with computed value, or NULL if just want to store the value in passed in "my_rec"

◆ innobase_get_cset_width()

void innobase_get_cset_width ( ulint  cset,
ulint *  mbminlen,
ulint *  mbmaxlen 
)

Get the variable length bounds of the given character set.

Parameters
csetin: MySQL charset-collation code
mbminlenout: minimum length of a char (in bytes)
mbmaxlenout: maximum length of a char (in bytes)

◆ innobase_get_err_msg()

const char* innobase_get_err_msg ( int  error_code)

Get the error message format string.

Returns
the format string or 0 if not found.
Parameters
error_codein: MySQL error code

◆ innobase_get_field_from_update_vector()

static dfield_t* innobase_get_field_from_update_vector ( dict_foreign_t foreign,
upd_t update,
ulint  col_no 
)
static

Get the updated parent field value from the update vector for the given col_no.

Parameters
[in]foreignforeign key information
[in]updateupdated parent vector.
[in]col_nobase column position of the child table to check
Returns
updated field from the parent update vector, else NULL

◆ innobase_get_index_column_cardinality()

static bool innobase_get_index_column_cardinality ( const char *  db_name,
const char *  table_name,
const char *  index_name,
uint  index_ordinal_position,
uint  column_ordinal_position,
dd::Object_id  se_private_id,
ulonglong cardinality 
)
static

Retrieve index column cardinality.

Parameters
[in]db_namename of schema
[in]table_namename of table
[in]index_namename of index
[in]index_ordinal_positionposition of index
[in]column_ordinal_positionposition of column in index
[in]se_private_idthe internal id of the table
[in,out]cardinalitycardinality of index column
Return values
falsesuccess
truefailure

If the table doesn't have persistent stats then load the table from disk.

◆ innobase_get_lower_case_table_names()

ulint innobase_get_lower_case_table_names ( void  )

Get the current setting of the lower_case_table_names global parameter from mysqld.cc.

We do a dirty read because for one there is no synchronization object and secondly there is little harm in doing so even if we get a torn read.

Returns
value of lower_case_table_names

◆ innobase_get_multi_value()

void innobase_get_multi_value ( const TABLE mysql_table,
ulint  f_idx,
dfield_t dfield,
multi_value_data value,
uint  old_val,
ulint  comp,
mem_heap_t heap 
)

Parse out multi-values from a MySQL record.

Parameters
[in]mysql_tableMySQL table structure
[in]f_idxfield index of the multi-value column
[in,out]dfieldfield structure to store parsed multi-value
[in,out]valuenullptr or the multi-value structure to store the parsed values
[in]old_valold value if exists
[in]comptrue if InnoDB table uses compact row format
[in,out]heapmemory heap

◆ innobase_get_multi_value_and_diff()

static void innobase_get_multi_value_and_diff ( const TABLE mysql_table,
ulint  field_idx,
dfield_t old_field,
dfield_t new_field,
uint  old_value,
ulint  comp,
mem_heap_t heap 
)
static

Parse out multi-values from both old and new MySQL records, at the meantime, calculate the difference between two records.

Parameters
[in]mysql_tableMySQL table structure
[in]field_idxfield index of the multi-value column
[in,out]old_fieldfield structure to store the parsed old value
[in,out]new_fieldfield structure to store the parsed new value
[in]old_valueold value to parse
[in]comptrue if InnoDB table uses compact row format
[in,out]heapmemory heap

◆ innobase_get_mysql_key_number_for_index()

static int innobase_get_mysql_key_number_for_index ( INNOBASE_SHARE share,
const TABLE table,
dict_table_t ib_table,
const dict_index_t index 
)
static

Calculates the key number used inside MySQL for an Innobase index.

We will first check the "index translation table" for a match of the index to get the index number. If there does not exist an "index translation table", or not able to find the index in the translation table, then we will fall back to the traditional way of looping through dict_index_t list to find a match. In this case, we have to take into account if we generated a default clustered index for the table

Returns
the key number used inside MySQL
Parameters
sharein: share structure for index translation table.
tablein: table in MySQL data dictionary
ib_tablein: table in InnoDB data dictionary
indexin: index

◆ innobase_get_stmt_safe()

size_t innobase_get_stmt_safe ( THD thd,
char *  buf,
size_t  buflen 
)

Determines the current SQL statement.

Thread safe, can be called from any thread as the string is copied into the provided buffer.

Parameters
[in]thdMySQL thread handle
[out]bufBuffer containing SQL statement
[in]buflenLength of provided buffer
Returns
Length of the SQL statement

◆ innobase_get_stmt_unsafe()

const char* innobase_get_stmt_unsafe ( THD thd,
size_t *  length 
)

Determines the current SQL statement.

Thread unsafe, can only be called from the thread owning the THD.

Parameters
[in]thdMySQL thread handle
[out]lengthLength of the SQL statement
Returns
SQL statement string

◆ innobase_get_table_cache_size()

ulint innobase_get_table_cache_size ( void  )

Get the current setting of the table_def_size global parameter.

Get the current setting of the table_cache_size global parameter.

We do a dirty read because for one there is no synchronization object and secondly there is little harm in doing so even if we get a torn read.

Returns
value of table_def_size

◆ innobase_get_table_statistics()

static bool innobase_get_table_statistics ( const char *  db_name,
const char *  table_name,
dd::Object_id  se_private_id,
const dd::Properties ts_se_private_data,
const dd::Properties tbl_se_private_data,
uint  stat_flags,
ha_statistics stats 
)
static

Retrieve table satistics.

Parameters
[in]db_namedatabase name
[in]table_nametable name
[in]se_private_idThe internal id of the table
[in]ts_se_private_dataTablespace SE Private data
[in]tbl_se_private_dataTable SE private data
[in]stat_flagsflags used to retrieve specific stats
[in,out]statsstructure to save the retrieved statistics
Returns
false on success, true on failure

If the table doesn't have persistent stats then load the table from disk.

◆ innobase_get_tablespace_filename_ext()

static const char * innobase_get_tablespace_filename_ext ( )
static

Get tablespace datafile name extension.

Return data filename extension for a InnoDB tablespace.

◆ innobase_get_tablespace_statistics()

static bool innobase_get_tablespace_statistics ( const char *  tablespace_name,
const char *  file_name,
const dd::Properties ts_se_private_data,
ha_tablespace_statistics stats 
)
static

Retrieve ha_tablespace_statistics for the tablespace.

Parameters
tablespace_nameTablespace_name
file_nameData file name.
ts_se_private_dataTablespace SE private data.
[out]statsContains tablespace statistics read from SE.
Returns
false on success, true on failure

Store maximum size
Store autoextend size

◆ innobase_get_tablespace_type()

static bool innobase_get_tablespace_type ( const dd::Tablespace space,
Tablespace_type space_type 
)
static

Retrieve the tablespace type.

Parameters
spaceTablespace object.
[out]space_typeTablespace category.
Returns
false on success, true on failure

◆ innobase_get_tablespace_type_by_name()

static bool innobase_get_tablespace_type_by_name ( const char *  tablespace_name,
Tablespace_type space_type 
)
static

Retrieve the tablespace type by name.

Get the tablespace type given the name.

Parameters
[in]tablespace_nameTablespace name.
[out]space_typeTablespace category.
Returns
false on success, true on failure
Parameters
[in]tablespace_nametablespace name
[out]space_typetype of space
Returns
Operation status.
Return values
falseon success and true for failure.

◆ innobase_index_cond()

ICP_RESULT innobase_index_cond ( ha_innobase h)



Index Condition Pushdown interface implementation

InnoDB index push-down condition check defined in ha_innodb.cc.

InnoDB index push-down condition check

Returns
ICP_NO_MATCH, ICP_MATCH, or ICP_OUT_OF_RANGE
Parameters
hin/out: pointer to ha_innobase

◆ innobase_index_lookup()

static dict_index_t* innobase_index_lookup ( INNOBASE_SHARE share,
uint  keynr 
)
static

This function uses index translation table to quickly locate the requested index structure.

Note we do not have mutex protection for the index translatoin table access, it is based on the assumption that there is no concurrent translation table rebuild (fter create/drop index) and DMLs that require index lookup.

Returns
dict_index_t structure for requested index. NULL if fail to locate the index structure.
Parameters
sharein: share structure for index translation table.
keynrin: index number for the requested index

◆ innobase_index_name_is_reserved()

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'.

If a name matches, this function pushes an warning message to the client, and returns true.

Returns
true if the index name matches the reserved name
Parameters
thdin/out: MySQL connection
key_infoin: Indexes to be created
num_of_keysin: Number of indexes to be created.

◆ innobase_init_files()

static int innobase_init_files ( dict_init_mode_t  dict_init_mode,
List< const Plugin_tablespace > *  tablespaces 
)
static

Open or create InnoDB data files.

Parameters
[in]dict_init_modewhether to create or open the files
[in,out]tablespacespredefined tablespaces created by the DDSE
Returns
0 on success, 1 on failure

◆ innobase_init_vc_templ()

void innobase_init_vc_templ ( dict_table_t table)

Get the computed value by supplying the base column values.

Parameters
[in,out]tabletable whose virtual column template to be built

◆ innobase_is_base_s_col()

static bool innobase_is_base_s_col ( const TABLE table,
const char *  name 
)
static

Check a column (name) is a base column for any stored column in the table.

Parameters
[in]tableTABLE* for the table
[in]namecolumn name to check
Returns
true if this is a base column

◆ innobase_is_dict_readonly()

static bool innobase_is_dict_readonly ( )
static

Check if InnoDB is in a mode where the data dictionary is read-only.

Returns
true if srv_read_only_mode is true or if srv_force_recovery > 0

◆ innobase_is_supported_system_table()

static bool innobase_is_supported_system_table ( const char *  db,
const char *  table_name,
bool  is_sql_layer_system_table 
)
static

This function checks if the given db.tablename is a system table supported by Innodb and is used as an initializer for the data member is_supported_system_table of InnoDB storage engine handlerton.

Currently we support only columns_priv, db, plugin, procs_priv, proxies_priv, servers, tables_priv, user, help- and time_zone- related system tables in InnoDB. Please don't add any SE-specific system tables here.

Parameters
dbdatabase name to check.
table_nametable name to check.
is_sql_layer_system_tableif the supplied db.table_name is a SQL layer system table.
Returns
whether the table name is supported

◆ innobase_is_valid_tablespace_name()

bool innobase_is_valid_tablespace_name ( ts_command_type  ts_cmd,
const char *  name 
)
static

Check tablespace name validity.

Parameters
[in]ts_cmdwhether this is tablespace DDL or not
[in]namename to check
Return values
falseinvalid name
truevalid name

◆ innobase_kill_connection()

static void innobase_kill_connection ( handlerton hton,
THD thd 
)
static

Cancel any pending lock request associated with the current THD.

in: MySQL thread handle for which to close the connection

Parameters
htonin/out: InnoDB handlerton
thdin: handle to the MySQL thread being killed

◆ innobase_lock_hton_log()

static bool innobase_lock_hton_log ( handlerton hton)
static

Implements Log_resource lock.

Parameters
[in]htonthe innodb handlerton
Returns
false on success

◆ innobase_map_isolation_level()

static ulint innobase_map_isolation_level ( enum_tx_isolation  iso)
inlinestatic

Maps a MySQL trx isolation level code to the InnoDB isolation level code.

Returns
InnoDB isolation level in: MySQL isolation level code
InnoDB isolation level
Parameters
isoin: MySQL isolation level code

◆ innobase_match_index_columns()

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.

Parameters
[in]key_infoIndex info from mysql
[in]index_infoIndex info from InnoDB
Returns
true if all column types match.

◆ innobase_mysql_fts_get_token()

ulint innobase_mysql_fts_get_token ( CHARSET_INFO cs,
const byte start,
const byte end,
fts_string_t token 
)

Get the next token from the given string and store it in *token.

It is mostly copied from MyISAM's doc parsing function ft_simple_get_word()

Returns
length of string processed
Parameters
csin: Character set
startin: start of text
endin: one character past end of text
tokenout: token's text

◆ innobase_mysql_print_thd()

void innobase_mysql_print_thd ( FILE *  f,
THD thd,
uint  max_query_len 
)

Prints info of a THD object (== user session thread) to the given file.

Parameters
fin: output stream
thdin: MySQL THD object
max_query_lenin: max query length to print, or 0 to use the default max length

◆ innobase_mysql_tmpdir()

char* innobase_mysql_tmpdir ( )

return any of the tmpdir path

◆ innobase_mysql_tmpfile()

int innobase_mysql_tmpfile ( const char *  path)

Creates a temporary file in the location specified by the parameter path.

If the path is NULL, then it will be created in –tmpdir.

Parameters
[in]pathlocation for creating temporary file
Returns
temporary file descriptor, or < 0 on error

◆ innobase_next_autoinc()

ulonglong innobase_next_autoinc ( ulonglong  current,
ulonglong  need,
ulonglong  step,
ulonglong  offset,
ulonglong  max_value 
)

Compute the next autoinc value.

For MySQL replication the autoincrement values can be partitioned among the nodes. The offset is the start or origin of the autoincrement value for a particular node. For n nodes the increment will be n and the offset will be in the interval [1, n]. The formula tries to allocate the next value for a particular node.

Note: This function is also called with increment set to the number of values we want to reserve for multi-value inserts e.g.,

    INSERT INTO T VALUES(), (), ();

innobase_next_autoinc() will be called with increment set to 3 where autoinc_lock_mode != TRADITIONAL because we want to reserve 3 values for the multi-value INSERT above.

Returns
the next value
Parameters
currentin: Current value
needin: count of values needed
stepin: AUTOINC increment step
offsetin: AUTOINC offset
max_valuein: max value for type

◆ innobase_page_track_get_num_page_ids()

static int innobase_page_track_get_num_page_ids ( uint64_t *  start_id,
uint64_t *  stop_id,
uint64_t *  num_pages 
)
static

Fetch approximate number of tracked pages in the given range.

Parameters
[in,out]start_idSE specific sequence number [LSN for Innodb] from where the pages tracked would be returned.
Note
the range might get expanded and the actual start_id used for the querying will be updated.
Parameters
[in,out]stop_idSE specific sequence number [LSN for Innodb] until where the pages tracked would be returned.
Note
the range might get expanded and the actual stop_id used for the querying will be updated.
Parameters
[out]num_pagesnumber of pages tracked
Returns
Operation status.
Return values
0Success
otherER_* mysql error. Get error details from THD.

◆ innobase_page_track_get_page_ids()

static int innobase_page_track_get_page_ids ( Page_Track_Callback  cbk_func,
void *  cbk_ctx,
uint64_t *  start_id,
uint64_t *  stop_id,
unsigned char *  buffer,
size_t  buffer_len 
)
static

Fetch tracked pages.

Parameters
[in]cbk_funccallback function return page IDs
[in]cbk_ctxcaller's context for callback
[in,out]start_idSE specific sequence number [LSN for Innodb] from where the pages tracked would be returned.
Note
The range might get expanded and the actual start_id used for the querying will be updated.
Parameters
[in,out]stop_idSE specific sequence number [LSN for Innodb] until where the pages tracked would be returned.
Note
The range might get expanded and the actual stop_id used for the querying will be updated.
Parameters
[out]bufferallocated buffer to copy page IDs
[in]buffer_lenlength of buffer in bytes
Returns
Operation status.
Return values
0Success
otherER_* mysql error. Get error details from THD.

◆ innobase_page_track_get_status()

static void innobase_page_track_get_status ( std::vector< std::pair< lsn_t, bool >> &  status)
static

Fetch the page tracking status.

Parameters
[out]statusvector of a pair of (ID, bool) where ID is the start/stop point and bool is true if the ID is a start point else false

◆ innobase_page_track_purge()

static int innobase_page_track_purge ( uint64_t *  purge_id)
static

Purge page tracking data.

Parameters
[in,out]purge_idPurge LSN initially indicating till where the data needs to be purged and finally updated to until where it was actually purged
Returns
Operation status.
Return values
0Success
otherER_* mysql error. Get error details from THD.

◆ innobase_page_track_start()

static int innobase_page_track_start ( uint64_t *  start_id)
static

Start page tracking.

Parameters
[out]start_idLSN indicating when the tracking was started
Returns
Operation status.
Return values
0Success
otherER_* mysql error. Get error details from THD.

◆ innobase_page_track_stop()

static int innobase_page_track_stop ( uint64_t *  stop_id)
static

Stop page tracking.

Parameters
[out]stop_idStop LSN indicating when the tracking was stopped
Returns
Operation status.
Return values
0Success
otherER_* mysql error. Get error details from THD.

◆ innobase_parse_hint_from_comment()

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.

Parameters
[in]thdconnection
[in,out]tabletarget table
[in]table_sharetable definition

◆ innobase_parse_merge_threshold()

static ulint innobase_parse_merge_threshold ( THD thd,
const char *  str 
)
static

Parse MERGE_THRESHOLD value from the string.

Parameters
[in]thdconnection
[in]strstring which might include 'MERGE_THRESHOLD='
Returns
value parsed. 0 means not found or invalid value.

◆ innobase_partition_flags()

static uint innobase_partition_flags ( )
static

Return partitioning flags.

◆ innobase_peek_autoinc()

static ulonglong innobase_peek_autoinc ( dict_table_t innodb_table,
bool  print_note 
)
static

Read the auto_increment counter of a table, using the AUTOINC lock irrespective of innodb_autoinc_lock_mode.

Parameters
[in,out]innodb_tableInnoDB table object
[in]print_notePrint note if not an I_S query.
Returns
the autoinc value

◆ innobase_post_ddl()

static void innobase_post_ddl ( THD thd)
static

Perform post-commit/rollback cleanup after DDL statement.

Parameters
[in,out]thdconnection thread

◆ innobase_post_recover()

static void innobase_post_recover ( )
static

DDL crash recovery: process the records recovered from "log_ddl" table.

◆ innobase_quote_identifier()

void innobase_quote_identifier ( FILE *  file,
trx_t trx,
const char *  id 
)

Quote a standard SQL identifier like tablespace, index or column name.

Parameters
[in]fileoutput stream
[in]trxInnoDB transaction, or NULL
[in]ididentifier to quote

◆ innobase_raw_format()

ulint innobase_raw_format ( const char *  data,
ulint  data_len,
ulint  charset_coll,
char *  buf,
ulint  buf_size 
)

Formats the raw data in "data" (in InnoDB on-disk format) that is of type DATA_(CHAR|VARCHAR|MYSQL|VARMYSQL) using "charset_coll" and writes the result to "buf".

The result is converted to "system_charset_info". Not more than "buf_size" bytes are written to "buf". The result is always NUL-terminated (provided buf_size > 0) and the number of bytes that were written to "buf" is returned (including the terminating NUL).

Returns
number of bytes that were written
Parameters
datain: raw data
data_lenin: raw data length in bytes
charset_collin: charset collation
bufout: output buffer
buf_sizein: output buffer size in bytes

◆ innobase_read_from_2_little_endian()

static uint innobase_read_from_2_little_endian ( const uchar buf)
inlinestatic

Reads an unsigned integer value < 64k from 2 bytes, in the little-endian storage format.

Returns
value
Parameters
bufin: from where to read

◆ innobase_register_trx()

void innobase_register_trx ( handlerton hton,
THD thd,
trx_t trx 
)

Registers an InnoDB transaction with the MySQL 2PC coordinator, so that the MySQL XA code knows to call the InnoDB prepare and commit, or rollback for the transaction.

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.

◆ innobase_release_savepoint()

static int innobase_release_savepoint ( handlerton hton,
THD thd,
void *  savepoint 
)
static

Release transaction savepoint name.

Returns
0 if success, HA_ERR_NO_SAVEPOINT if no savepoint with the given name in: savepoint data
0 if success, HA_ERR_NO_SAVEPOINT if no savepoint with the given name
Parameters
htonin/out: handlerton for InnoDB
thdin: handle to the MySQL thread of the user whose transaction's savepoint should be released
savepointin: savepoint data

◆ innobase_rename_vc_templ()

void innobase_rename_vc_templ ( dict_table_t table)

Change dbname and table name in table->vc_templ.

Parameters
[in,out]tabletable whose virtual column template dbname and tbname to be renamed.

◆ innobase_rollback()

static int innobase_rollback ( handlerton hton,
THD thd,
bool  rollback_trx 
)
static

Rolls back a transaction to a savepoint.

Rolls back a transaction or the latest SQL statement.

Returns
0 if success, HA_ERR_NO_SAVEPOINT if no savepoint with the given name in: TRUE - rollback entire transaction FALSE - rollback the current statement only
0 or error number
Parameters
htonin/out: InnoDB handlerton
thdin: handle to the MySQL thread of the user whose transaction should be rolled back
rollback_trxin: TRUE - rollback entire transaction FALSE - rollback the current statement only

◆ innobase_rollback_by_xid()

static xa_status_code innobase_rollback_by_xid ( handlerton hton,
XID xid 
)
static

This function is used to rollback one X/Open XA distributed transaction which is in the prepared state.

Returns
0 or error number in: X/Open XA transaction identification
0 or error number
Parameters
htonin: InnoDB handlerton
xidin: X/Open XA transaction identification

◆ innobase_rollback_to_savepoint()

static int innobase_rollback_to_savepoint ( handlerton hton,
THD thd,
void *  savepoint 
)
static

Rolls back a transaction to a savepoint.

Returns
0 if success, HA_ERR_NO_SAVEPOINT if no savepoint with the given name in: savepoint data
0 if success, HA_ERR_NO_SAVEPOINT if no savepoint with the given name
Parameters
htonin/out: InnoDB handlerton
thdin: handle to the MySQL thread of the user whose XA transaction should be rolled back to savepoint
savepointin: savepoint data

◆ innobase_rollback_to_savepoint_can_release_mdl()

static bool innobase_rollback_to_savepoint_can_release_mdl ( handlerton hton,
THD thd 
)
static

Check whether innodb state allows to safely release MDL locks after rollback to savepoint.

Returns
true if it is safe, false if its not safe. in: handle to the MySQL thread of the user whose XA transaction should be rolled back to savepoint

When binlog is on, MDL locks acquired after savepoint unit are not released if there are any locks held in InnoDB.

Returns
true if it is safe, false if its not safe.
Parameters
htonin/out: InnoDB handlerton
thdin: handle to the MySQL thread of the user whose transaction should be rolled back to savepoint

◆ innobase_rollback_trx()

static int innobase_rollback_trx ( trx_t trx)
static

Rolls back a transaction.

Returns
0 or error number
Parameters
trxin: transaction

◆ innobase_savepoint()

static int innobase_savepoint ( handlerton hton,
THD thd,
void *  savepoint 
)
static

Sets a transaction savepoint.

Returns
always 0, that is, always succeeds in: savepoint data
always 0, that is, always succeeds
Parameters
htonin/out: InnoDB handlerton
thdin: handle to the MySQL thread of the user's XA transaction for which we need to take a savepoint
savepointin: savepoint data

◆ innobase_should_madvise_buf_pool()

bool innobase_should_madvise_buf_pool ( )

Checks sys_vars and determines if allocator should mark large memory segments with MADV_DONTDUMP.

Returns
true iff @global.core_file AND NOT @global.innodb_buffer_pool_in_core_file

◆ innobase_show_status()

static bool innobase_show_status ( handlerton hton,
THD thd,
stat_print_fn stat_print,
enum ha_stat_type  stat_type 
)
static

Return 0 on success and non-zero on failure.

Note: the bool return type seems to be abused here, should be an int.

Parameters
[in]htonthe innodb handlerton
[in]thdthe MySQL query thread of the caller
[in]stat_printprint function
[in]stat_typestatus to show

◆ innobase_srv_conc_enter_innodb()

static void innobase_srv_conc_enter_innodb ( row_prebuilt_t prebuilt)
inlinestatic

Enter InnoDB engine after checking the max number of user threads allowed, else the thread is put into sleep.

Parameters
[in,out]prebuiltrow prebuilt handler

◆ innobase_srv_conc_exit_innodb()

static void innobase_srv_conc_exit_innodb ( row_prebuilt_t prebuilt)
inlinestatic

Note that the thread wants to leave InnoDB only if it doesn't have any spare tickets.

Parameters
[in,out]prebuiltrow prebuilt handler

◆ innobase_srv_conc_force_exit_innodb()

static void innobase_srv_conc_force_exit_innodb ( trx_t trx)
inlinestatic

Force a thread to leave InnoDB even if it has spare tickets.

Parameters
trxin: transaction handle

◆ innobase_start_trx_and_assign_read_view()

static int innobase_start_trx_and_assign_read_view ( handlerton hton,
THD thd 
)
static

Creates an InnoDB transaction struct for the thd if it does not yet have one.

Starts a new InnoDB transaction if a transaction is not yet started. And assigns a new snapshot for a consistent read if the transaction does not yet have one.

Returns
0
Parameters
htonin: InnoDB handlerton
thdin: MySQL thread handle of the user for whom the transaction should be committed

◆ innobase_store_multi_value()

static bool innobase_store_multi_value ( json_binary::Value v,
multi_value_data value,
Field_typed_array fld,
dfield_t dfield,
bool  comp,
mem_heap_t heap 
)
inlinestatic

Handle the multi-value array, parse the values and store them.

Parameters
[in]vJSON binary that has the mult-value
[out]valuestore the parsed out value
[in]fldarray Field for the data
[in]dfieldInnoDB indexed field struct
[in]compif this is new InnoDB row type
[in,out]heapheap memory
Returns
true if values are valid and stored, otherwise false

◆ innobase_store_multi_value_low()

static void innobase_store_multi_value_low ( json_binary::Value bv,
multi_value_data **  valuep,
Field_typed_array fld,
dfield_t dfield,
ulint  comp,
mem_heap_t heap 
)
static

Parse out multi-value and store in a multi_value_data struct.

Parameters
[in]bvJSON binary that has the mult-value
[out]valuepstore the parsed out value
[in]fldArray Field for the data
[in]dfieldInnoDB indexed field struct
[in]compif this is new InnoDB row type
[in,out]heapheap memory

◆ innobase_strcasecmp()

int innobase_strcasecmp ( const char *  a,
const char *  b 
)

Compares NUL-terminated UTF-8 strings case insensitively.

Returns
0 if a=b, <0 if a<b, >1 if a>b
Parameters
ain: first string to compare
bin: second string to compare

◆ innobase_strnxfrm()

ulint innobase_strnxfrm ( const CHARSET_INFO cs,
const uchar str,
const ulint  len 
)

Get the first character's code position for FTS index partition.

Parameters
csin: Character set
strin: string
lenin: string length

◆ innobase_trx_allocate()

trx_t* innobase_trx_allocate ( THD thd)

Allocates an InnoDB transaction for a MySQL handler object for DML.



Allocates an InnoDB transaction for a MySQL handler object.

Returns
InnoDB transaction handle
Parameters
thdin: user thread handle

◆ innobase_trx_init()

static void innobase_trx_init ( THD thd,
trx_t trx 
)
static

Initializes some fields in an InnoDB transaction object.

Parameters
thdin: user thread handle
trxin/out: InnoDB transaction handle

◆ innobase_unlock_hton_log()

static bool innobase_unlock_hton_log ( handlerton hton)
static

Implements Log_resource unlock.

Parameters
[in]htonthe innodb handlerton
Returns
false on success

◆ innobase_vcol_build_templ()

static void innobase_vcol_build_templ ( const TABLE table,
const dict_index_t clust_index,
Field field,
const dict_col_t col,
mysql_row_templ_t templ,
ulint  col_no 
)
static

Build a template for a base column for a virtual column.

Parameters
[in]tableMySQL TABLE
[in]clust_indexInnoDB clustered index
[in]fieldfield in MySQL table
[in]colInnoDB column
[in,out]templtemplate to fill
[in]col_nofield index for virtual col

◆ innobase_wildcasecmp()

static int innobase_wildcasecmp ( const char *  a,
const char *  b 
)
static

Compares NUL-terminated UTF-8 strings case insensitively.

The second string contains wildcards.

Returns
0 if a match is found, 1 if not
Parameters
ain: string to compare
bin: wildcard string to compare

◆ innobase_xa_prepare()

static int innobase_xa_prepare ( handlerton hton,
THD thd,
bool  prepare_trx 
)
static

This function is used to prepare an X/Open XA distributed transaction.

Returns
0 or error number in: true - prepare transaction false - the current SQL statement ended
0 or error number
Parameters
htonin: InnoDB handlerton
thdin: handle to the MySQL thread of the user whose XA transaction should be prepared
prepare_trxin: true - prepare transaction false - the current SQL statement ended

◆ innobase_xa_recover()

static int innobase_xa_recover ( handlerton hton,
XA_recover_txn txn_list,
uint  len,
MEM_ROOT mem_root 
)
static

This function is used to recover X/Open XA distributed transactions.

Returns
number of prepared transactions stored in xid_list in: memory for table names
number of prepared transactions stored in xid_list
Parameters
htonin: InnoDB handlerton
txn_listin/out: prepared transactions
lenin: number of slots in xid_list
mem_rootin: memory for table names

◆ innodb_adaptive_hash_index_update()

static void innodb_adaptive_hash_index_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_adaptive_hash_index using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
thdin: thread handle
varin: pointer to system variable
var_ptrout: where the formal string goes
savein: immediate result from check function

◆ innodb_alter_tablespace()

static int innodb_alter_tablespace ( handlerton hton,
THD thd,
st_alter_tablespace alter_info,
const dd::Tablespace old_dd_space,
dd::Tablespace new_dd_space 
)
static

ALTER an undo tablespace.

Parameters
[in]htonHandlerton of InnoDB
[in]thdConnection
[in]alter_infoHow to do the command
[in]old_dd_spaceTablespace metadata
[in]new_dd_spaceTablespace metadata
Returns
MySQL error code

◆ innodb_alter_undo_tablespace()

static int innodb_alter_undo_tablespace ( handlerton hton,
THD thd,
st_alter_tablespace alter_info,
dd::Tablespace dd_space 
)
static

ALTER an undo tablespace.

Either make it ACTIVE or INACTIVE.

Parameters
[in]htonHandlerton of InnoDB
[in]thdConnection
[in]alter_infoHow to do the command
[in]dd_spaceTablespace metadata
Returns
MySQL error code

◆ innodb_alter_undo_tablespace_active()

static int innodb_alter_undo_tablespace_active ( handlerton hton,
THD thd,
undo::Tablespace undo_space,
dd::String_type  dd_state,
dd::Tablespace dd_space 
)
static

ALTER an undo tablespace to ACTIVE.

Parameters
[in]htonHandlerton of InnoDB
[in]thdConnection
[in]undo_spaceUndo Tablespace object
[in]dd_stateCurrent state in the DD.
[in]dd_spaceTablespace metadata
Returns
MySQL error code

◆ innodb_alter_undo_tablespace_inactive()

static int innodb_alter_undo_tablespace_inactive ( handlerton hton,
THD thd,
undo::Tablespace undo_space,
dd::String_type  dd_state,
dd::Tablespace dd_space 
)
static

ALTER an undo tablespace to INACTIVE.

Parameters
[in]htonHandlerton of InnoDB
[in]thdConnection
[in]undo_spaceUndo Tablespace object
[in]dd_stateCurrent state in the DD.
[in]dd_spaceTablespace metadata
Returns
MySQL error code

◆ innodb_base_col_setup()

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.

Parameters
[in]tableInnoDB table
[in]fieldMySQL field
[in,out]v_colvirtual column

◆ innodb_base_col_setup_for_stored()

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.

Parameters
[in]tableInnoDB table
[in]fieldMySQL field
[in,out]s_colstored column

◆ innodb_buffer_pool_evict_uncompressed()

static bool innodb_buffer_pool_evict_uncompressed ( void  )
static

Evict all uncompressed pages of compressed tables from the buffer pool.

Keep the compressed pages in the buffer pool.

Returns
whether all uncompressed pages were evicted

◆ innodb_buffer_pool_evict_update()

static void innodb_buffer_pool_evict_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Called on SET GLOBAL innodb_buffer_pool_evict=...

Handles some values specially, to evict pages from the buffer pool. SET GLOBAL innodb_buffer_pool_evict='uncompressed' evicts all uncompressed page frames of compressed tablespaces.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrignored
[in]saveimmediate result from check function

◆ innodb_buffer_pool_size_init()

static void innodb_buffer_pool_size_init ( )
static

Initialize and normalize innodb_buffer_pool_size.

◆ innodb_buffer_pool_size_update()

static void innodb_buffer_pool_size_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_buffer_pool_size using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ innodb_buffer_pool_size_validate()

static bool innodb_buffer_pool_size_validate ( THD thd,
longlong  buffer_pool_size,
ulint &  aligned_buffer_pool_size 
)
static

Validate the requested buffer pool size.

Also, reserve the necessary memory needed for buffer pool resize.

Parameters
[in]thdthread handle
[in]buffer_pool_sizebuffer pool size value to be validated
[out]aligned_buffer_pool_sizealigned version of buffer_pool_size if validation succeeds, else original value passed in
Returns
true on success, false on failure.

◆ innodb_change_buffer_max_size_update()

static void innodb_change_buffer_max_size_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_old_blocks_pct using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
thdin: thread handle
varin: pointer to system variable
var_ptrout: where the formal string goes
savein: immediate result from check function

◆ innodb_check_fk_column_compat()

static bool innodb_check_fk_column_compat ( const Ha_fk_column_type child_column_type,
const Ha_fk_column_type parent_column_type,
bool  check_charsets 
)
static

Check if types of child and parent columns in foreign key are compatible.

Parameters
[in]child_column_typeChild column type description.
[in]parent_column_typeParent column type description.
[in]check_charsetsIndicates whether we need to check that charsets of string columns match. Which is true in most cases.
Returns
True if types are compatible, False if not.

◆ innodb_cmp_per_index_update()

static void innodb_cmp_per_index_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_cmp_per_index using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
thdin: thread handle
varin: pointer to system variable
var_ptrout: where the formal string goes
savein: immediate result from check function

◆ innodb_create_tablespace()

static int innodb_create_tablespace ( handlerton hton,
THD thd,
st_alter_tablespace alter_info,
dd::Tablespace dd_space 
)
static

CREATE a tablespace.

Parameters
[in]htonHandlerton of InnoDB
[in]thdConnection
[in]alter_infoHow to do the command
[in,out]dd_spaceTablespace metadata
Returns
MySQL error code

◆ innodb_create_undo_tablespace()

static int innodb_create_undo_tablespace ( handlerton hton,
THD thd,
st_alter_tablespace alter_info,
dd::Tablespace dd_space 
)
static

CREATE an undo tablespace.

Parameters
[in]htonHandlerton of InnoDB
[in]thdConnection
[in]alter_infoHow to do the command
[in,out]dd_spaceTablespace metadata
Returns
MySQL error code

◆ innodb_disable_monitor_update()

static void innodb_disable_monitor_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_monitor_disable and turn off specified monitor counter.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ innodb_drop_tablespace()

static int innodb_drop_tablespace ( handlerton hton,
THD thd,
st_alter_tablespace alter_info,
const dd::Tablespace dd_space 
)
static

DROP a tablespace.

Parameters
[in]htonHandlerton of InnoDB
[in]thdConnection
[in]alter_infoHow to do the command
[in]dd_spaceTablespace metadata
Returns
MySQL error code

◆ innodb_drop_undo_tablespace()

static int innodb_drop_undo_tablespace ( handlerton hton,
THD thd,
st_alter_tablespace alter_info,
const dd::Tablespace dd_space 
)
static

DROP an undo tablespace.

Parameters
[in]htonHandlerton of InnoDB
[in]thdConnection
[in]alter_infoHow to do the command
[in]dd_spaceTablespace metadata
Returns
MySQL error code

◆ innodb_enable_monitor_at_startup()

static void innodb_enable_monitor_at_startup ( char *  str)
static

Parse and enable InnoDB monitor counters during server startup.

User can enable monitor counters/groups by specifying "loose-innodb_monitor_enable = monitor_name1;monitor_name2..." in server configuration file or at the command line. in: monitor counter enable list

User can list the monitor counters/groups to be enable by specifying "loose-innodb_monitor_enable=monitor_name1;monitor_name2..." in server configuration file or at the command line. The string separate could be ";", "," or empty space.

Parameters
strin/out: monitor counter enable list

◆ innodb_enable_monitor_update()

static void innodb_enable_monitor_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_monitor_enable and enable specified monitor counter.

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ innodb_export_status()

static void innodb_export_status ( )
static

Here we export InnoDB status variables to MySQL.

◆ innodb_fill_fake_column_struct()

static void innodb_fill_fake_column_struct ( dict_col_t col,
const Ha_fk_column_type fk_col_type 
)
static

Constructs fake dict_col_t describing column for foreign key type compatibility check from column description in Ha_fk_column_type form.

Note
dict_col_t which is produced by this call is not valid for general purposes.
Parameters
[out]coldict_col_t filled by this function
[in]fk_col_typeforeign key type information

◆ innodb_fill_old_vcol_val()

static byte* innodb_fill_old_vcol_val ( row_prebuilt_t prebuilt,
dfield_t vfield,
ulint  o_len,
dict_col_t col,
const byte old_mysql_row_col,
ulint  col_pack_len,
byte buf 
)
static

Fill the update vector's "old_vrow" field for those non-updated, but indexed columns.

Such columns could stil present in the virtual index rec fields even if they are not updated (some other fields updated), so needs to be logged.

Parameters
[in]prebuiltInnoDB prebuilt struct
[in,out]vfieldfield to filled
[in]o_lenactual column length
[in,out]colcolumn to be filled
[in]old_mysql_row_colMySQL old field ptr
[in]col_pack_lenMySQL field col length
[in,out]bufbuffer for a converted integer value
Returns
used buffer ptr from row_mysql_store_col_in_innobase_format()

◆ innodb_get_auto_increment_for_uncached()

static ib_uint64_t innodb_get_auto_increment_for_uncached ( dd::Object_id  se_private_id,
const dd::Properties tbl_se_private_data 
)
static

Get the autoincrement for the given table id which is not in the cache.

Parameters
[in]se_private_idInnoDB table id
[in]tbl_se_private_datatable SE private data
Returns
autoincrement value for the given table_id.

Get the auto_increment from the table SE private data.

Get the auto_increment value from innodb_dynamic_metadata

table.

◆ innodb_get_table_statistics_for_uncached()

static bool innodb_get_table_statistics_for_uncached ( const char *  db_name,
const char *  tbl_name,
const char *  norm_name,
dd::Object_id  se_private_id,
const dd::Properties ts_se_private_data,
const dd::Properties tbl_se_private_data,
ulint  stat_flags,
ha_statistics stats 
)
static

Retrieves table statistics only for uncache table only.

Parameters
[in]db_namedatabase name
[in]tbl_nametable name
[in]norm_nametablespace name
[in]se_private_idInnoDB table id
[in]ts_se_private_datatablespace se private data
[in]tbl_se_private_datatable se private data
[in]stat_flagsflags used to retrieve specific stats
[in,out]statsstructure to save the retrieved statistics
Returns
true if the stats information filled successfully
false if tablespace is missing or table doesn't have persistent stats.

Server passes dummy ts_se_private_data for file_per_table tablespace. In that case, InnoDB should find the space_id using the tablespace name.
Tablespace is missing in this case.

◆ innodb_init()

static int innodb_init ( void *  p)
static

Initialize the InnoDB storage engine plugin.

Parameters
[in,out]pInnoDB handlerton
Returns
error code
Return values
0on success

Count of Performance Schema keys that have been registered.

◆ innodb_init_abort()

static int innodb_init_abort ( )
static

Free any resources that were allocated and return failure.

Returns
always return 1

◆ innodb_init_params()

static int innodb_init_params ( )
static

Initialize, validate and normalize the InnoDB startup parameters.

Returns
failure code
Return values
0on success
HA_ERR_OUT_OF_MEMwhen out of memory
HA_ERR_INITIALIZATIONwhen some parameters are out of range

◆ innodb_internal_table_update()

static void innodb_internal_table_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update global variable "fts_internal_tbl_name" with the "saved" stopword table name value.

This function is registered as a callback with MySQL.

Parameters
thdin: thread handle
varin: pointer to system variable
var_ptrout: where the formal string goes
savein: immediate result from check function

◆ innodb_internal_table_validate()

static int innodb_internal_table_validate ( THD thd,
SYS_VAR var,
void *  save,
struct st_mysql_value value 
)
static

Check whether valid argument given to "innodb_fts_internal_tbl_name" This function is registered as a callback with MySQL.

Returns
0 for valid stopword table
Parameters
thdin: thread handle
varin: pointer to system variable
saveout: immediate result for update function
valuein: incoming string

◆ innodb_io_capacity_max_update()

static void innodb_io_capacity_max_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_io_capacity_max using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
thdin: thread handle
varin: pointer to system variable
var_ptrout: where the formal string goes
savein: immediate result from check function

◆ innodb_io_capacity_update()

static void innodb_io_capacity_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_io_capacity using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
thdin: thread handle
varin: pointer to system variable
var_ptrout: where the formal string goes
savein: immediate result from check function

◆ innodb_log_buffer_size_update()

static void innodb_log_buffer_size_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_log_buffer_size using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ innodb_log_checksums_func_update()

static void innodb_log_checksums_func_update ( bool  check)
static

Update log_checksum_algorithm_ptr with a pointer to the function corresponding to whether checksums are enabled.

Parameters
[in]checkwhether redo log block checksums are enabled

◆ innodb_log_checksums_update()

static void innodb_log_checksums_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the innodb_log_checksums parameter.

Parameters
[in]thdthread handle
[in]varsystem variable
[out]var_ptrcurrent value
[in]saveimmediate result from check function

◆ innodb_log_file_size_init()

static int innodb_log_file_size_init ( )
static

Initialize and normalize innodb_log_file_size and innodb_log_files_in_group.

◆ innodb_log_write_ahead_size_update()

static void innodb_log_write_ahead_size_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_log_write_ahead_size using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ innodb_make_page_dirty()

static void innodb_make_page_dirty ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Make the first page of given user tablespace dirty.

Parameters
thdin: thread handle
varin: pointer to system variable
var_ptrout: where the formal string goes
savein: immediate result from check function

◆ innodb_max_dirty_pages_pct_lwm_update()

static void innodb_max_dirty_pages_pct_lwm_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_max_dirty_pages_pct_lwm using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
thdin: thread handle
varin: pointer to system variable
var_ptrout: where the formal string goes
savein: immediate result from check function

◆ innodb_max_dirty_pages_pct_update()

static void innodb_max_dirty_pages_pct_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_max_dirty_pages_pct using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
thdin: thread handle
varin: pointer to system variable
var_ptrout: where the formal string goes
savein: immediate result from check function

◆ innodb_merge_threshold_set_all_debug_update()

static void innodb_merge_threshold_set_all_debug_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Override current MERGE_THRESHOLD setting for all indexes at dictionary now.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ innodb_monitor_id_by_name_get()

static ulint innodb_monitor_id_by_name_get ( const char *  name)
static

Given a configuration variable name, find corresponding monitor counter and return its monitor ID if found.

Returns
monitor ID if found, MONITOR_NO_MATCH if there is no match
Parameters
namein: monitor counter namer

◆ innodb_monitor_set_option()

static void innodb_monitor_set_option ( const monitor_info_t monitor_info,
mon_option_t  set_option 
)
static

Update the monitor counter according to the "set_option", turn on/off or reset specified monitor counter.

Parameters
monitor_infoin: monitor info for the monitor to set
set_optionin: Turn on/off reset the counter

◆ innodb_monitor_update()

static void innodb_monitor_update ( THD thd,
void *  var_ptr,
const void *  save,
mon_option_t  set_option,
ibool  free_mem 
)
static

Update the system variable innodb_enable(disable/reset/reset_all)_monitor according to the "set_option" and turn on/off or reset specified monitor counter.

Parameters
thdin: thread handle
var_ptrout: where the formal string goes
savein: immediate result from check function
set_optionin: the set option, whether to turn on/off or reset the counter
free_memin: whether we will need to free the memory

◆ innodb_monitor_update_wildcard()

static void innodb_monitor_update_wildcard ( const char *  name,
mon_option_t  set_option 
)
static

Find matching InnoDB monitor counters and update their status according to the "set_option", turn on/off or reset specified monitor counter.

Parameters
namein: monitor name to match
set_optionin: the set option, whether to turn on/off or reset the counter

◆ innodb_monitor_valid_byname()

static int innodb_monitor_valid_byname ( void *  save,
const char *  name 
)
static

Validate the passed in monitor name, find and save the corresponding monitor name in the function parameter "save".

Returns
0 if monitor name is valid
Parameters
saveout: immediate result for update function
namein: incoming monitor name

◆ innodb_monitor_validate()

static int innodb_monitor_validate ( THD thd,
SYS_VAR var,
void *  save,
struct st_mysql_value value 
)
static

Validate passed-in "value" is a valid monitor counter name.

This function is registered as a callback with MySQL.

Returns
0 for valid name
Parameters
thdin: thread handle
varin: pointer to system variable
saveout: immediate result for update function
valuein: incoming string

◆ innodb_monitor_validate_wildcard_name()

static ibool innodb_monitor_validate_wildcard_name ( const char *  name)
static

Validate that the passed in monitor name matches at least one monitor counter name with wildcard compare.

Returns
true if at least one monitor name matches
Parameters
namein: monitor counter namer

◆ innodb_old_blocks_pct_update()

static void innodb_old_blocks_pct_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_old_blocks_pct using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
thdin: thread handle
varin: pointer to system variable
var_ptrout: where the formal string goes
savein: immediate result from check function

◆ innodb_pre_dd_shutdown()

static void innodb_pre_dd_shutdown ( handlerton )
static

Shut down all InnoDB background tasks that may access the Global Data Dictionary, before the Global Data Dictionary and the rest of InnoDB have been shut down.

See also
dd::shutdown()
innodb_shutdown()

◆ innodb_rec_per_key()

rec_per_key_t innodb_rec_per_key ( const dict_index_t index,
ulint  i,
ha_rows  records 
)

Calculate Record Per Key value.

Excludes the NULL value if innodb_stats_method is set to "nulls_ignored"

Parameters
[in]indexdict_index_t structure
[in]icolumn we are calculating rec per key
[in]recordsestimated total records
Returns
estimated record per key value

◆ innodb_replace_trx_in_thd()

static void innodb_replace_trx_in_thd ( THD thd,
void *  new_trx_arg,
void **  ptr_trx_arg 
)
static

InnoDB transaction object that is currently associated with THD is replaced with that of the 2nd argument.

The previous value is returned through the 3rd argument's buffer, unless it's NULL. When the buffer is not provided (value NULL) that should mean the caller restores previously saved association so the current trx has to be additionally freed from all association with MYSQL.

Parameters
[in,out]thdMySQL thread handle
[in]new_trx_argreplacement trx_t
[in,out]ptr_trx_argpointer to a buffer to store old trx_t

◆ innodb_reset_all_monitor_update()

static void innodb_reset_all_monitor_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_monitor_reset_all and reset all value related monitor counter.

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ innodb_reset_monitor_update()

static void innodb_reset_monitor_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_monitor_reset and reset specified monitor counter(s).

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ innodb_rollback_segments_update()

static void innodb_rollback_segments_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the number of rollback segments per tablespace when the system variable innodb_rollback_segments is changed.

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[in]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ innodb_save_page_no()

static void innodb_save_page_no ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Save an InnoDB page number.

Parameters
thdin: thread handle
varin: pointer to system variable
var_ptrout: where the formal string goes
savein: immediate result from check function

◆ innodb_set_buf_pool_size()

void innodb_set_buf_pool_size ( long long  buf_pool_size)

Update the system variable with the given value of the InnoDB buffer pool size.

Parameters
[in]buf_pool_sizegiven value of buffer pool size.

◆ innodb_show_latch_status()

static int innodb_show_latch_status ( handlerton hton,
THD thd,
stat_print_fn stat_print 
)
static

Implements the SHOW MUTEX STATUS command.

Parameters
[in,out]htonthe innodb handlerton
[in,out]thdthe MySQL query thread of the caller
[in,out]stat_printfunction for printing statistics
Returns
0 on success.

◆ innodb_show_mutex_status()

static int innodb_show_mutex_status ( handlerton hton,
THD thd,
stat_print_fn stat_print 
)
static

Implements the SHOW MUTEX STATUS command, for mutexes.

Parameters
[in,out]htonthe innodb handlerton
[in,out]thdthe MySQL query thread of the caller
[in,out]stat_printfunction for printing statistics
Returns
0 on success.

◆ innodb_show_rwlock_status()

static int innodb_show_rwlock_status ( handlerton hton,
THD thd,
stat_print_fn stat_print 
)
static

Implements the SHOW MUTEX STATUS command.

Parameters
[in,out]htonthe innodb handlerton
[in,out]thdthe MySQL query thread of the caller
[in,out]stat_printfunction for printing statistics
Returns
0 on success.

◆ innodb_show_status()

static int innodb_show_status ( handlerton hton,
THD thd,
stat_print_fn stat_print 
)
static

Implements the SHOW ENGINE INNODB STATUS command.

Sends the output of the InnoDB Monitor to the client.

Parameters
[in]htonthe innodb handlerton
[in]thdthe MySQL query thread of the caller
[in]stat_printprint function
Returns
0 on success

◆ innodb_shutdown()

static int innodb_shutdown ( handlerton ,
ha_panic_function   
)
static

Shut down InnoDB after the Global Data Dictionary has been shut down.

See also
innodb_pre_dd_shutdown()
Return values
0always

◆ innodb_space_shutdown()

static void innodb_space_shutdown ( )
static

Free tablespace resources.

◆ innodb_srv_buffer_pool_in_core_file_update()

static void innodb_srv_buffer_pool_in_core_file_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

◆ innodb_status_output_update()

static void innodb_status_output_update ( THD ,
SYS_VAR ,
void *  var_ptr,
const void *  save 
)
static

Update innodb_status_output or innodb_status_output_locks, which control InnoDB "status monitor" output to the error log.

Parameters
[out]var_ptrcurrent value
[in]saveto-be-assigned value

◆ innodb_stopword_table_validate()

static int innodb_stopword_table_validate ( THD thd,
SYS_VAR var,
void *  save,
struct st_mysql_value value 
)
static

Check whether valid argument given to innodb_ft_*_stopword_table.

Check whether valid argument given to innobase_*_stopword_table.

This function is registered as a callback with MySQL.

Returns
0 for valid stopword table in: incoming string

This function is registered as a callback with MySQL.

Returns
0 for valid stopword table
Parameters
thdin: thread handle
varin: pointer to system variable
saveout: immediate result for update function
valuein: incoming string

◆ innodb_thread_concurrency_update()

static void innodb_thread_concurrency_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Update the system variable innodb_thread_concurrency using the "saved" value.

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[out]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ innodb_tmpdir_validate()

static int innodb_tmpdir_validate ( THD thd,
SYS_VAR var,
void *  save,
struct st_mysql_value value 
)
static

Validate passed-in "value" is a valid directory name.

This function is registered as a callback with MySQL.

Parameters
[in,out]thdthread handle
[in]varpointer to system variable
[out]saveimmediate result for update
[in]valueincoming string
Returns
0 for valid name

◆ innodb_undo_tablespaces_deprecate()

static void innodb_undo_tablespaces_deprecate ( )
static

Validate innodb_undo_tablespaces.

Log a warning if it was set explicitly.

◆ innodb_undo_tablespaces_update()

static void innodb_undo_tablespaces_update ( THD thd,
SYS_VAR var,
void *  var_ptr,
const void *  save 
)
static

Validate the value of innodb_undo_tablespaces global variable.

This function is registered as a callback with MySQL.

Parameters
[in]thdthread handle
[in]varpointer to system variable
[in]var_ptrwhere the formal string goes
[in]saveimmediate result from check function

◆ mysql_declare_plugin()

mysql_declare_plugin ( innobase  )

◆ MYSQL_SYSVAR_BOOL() [1/54]

static MYSQL_SYSVAR_BOOL ( log_checksums  ,
srv_log_checksums  ,
PLUGIN_VAR_RQCMDARG  ,
"Whether to compute and require checksums for InnoDB redo log blocks"  ,
NULL  ,
innodb_log_checksums_update  ,
TRUE   
)
static

◆ MYSQL_SYSVAR_BOOL() [2/54]

static MYSQL_SYSVAR_BOOL ( doublewrite  ,
innobase_use_doublewrite  ,
PLUGIN_VAR_NOCMDARG PLUGIN_VAR_READONLY,
"Enable InnoDB doublewrite buffer (enabled by default)." " Disable with --skip-innodb-doublewrite."  ,
NULL  ,
NULL  ,
TRUE   
)
static

◆ MYSQL_SYSVAR_BOOL() [3/54]

static MYSQL_SYSVAR_BOOL ( stats_include_delete_marked  ,
srv_stats_include_delete_marked  ,
PLUGIN_VAR_OPCMDARG  ,
"Include delete marked records when calculating persistent statistics"  ,
NULL  ,
NULL  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [4/54]

static MYSQL_SYSVAR_BOOL ( background_drop_list_empty  ,
innodb_background_drop_list_empty  ,
PLUGIN_VAR_OPCMDARG  ,
"Wait for the background drop list to become empty"  ,
NULL  ,
wait_background_drop_list_empty  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [5/54]

static MYSQL_SYSVAR_BOOL ( purge_run_now  ,
innodb_purge_run_now  ,
PLUGIN_VAR_OPCMDARG  ,
"Set purge state to RUN"  ,
NULL  ,
purge_run_now_set  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [6/54]

static MYSQL_SYSVAR_BOOL ( purge_stop_now  ,
innodb_purge_stop_now  ,
PLUGIN_VAR_OPCMDARG  ,
"Set purge state to STOP"  ,
NULL  ,
purge_stop_now_set  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [7/54]

static MYSQL_SYSVAR_BOOL ( log_checkpoint_now  ,
innodb_log_checkpoint_now  ,
PLUGIN_VAR_OPCMDARG  ,
"Force sharp checkpoint now"  ,
NULL  ,
checkpoint_now_set  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [8/54]

static MYSQL_SYSVAR_BOOL ( log_checkpoint_fuzzy_now  ,
innodb_log_checkpoint_fuzzy_now  ,
PLUGIN_VAR_OPCMDARG  ,
"Force fuzzy checkpoint now"  ,
NULL  ,
checkpoint_fuzzy_now_set  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [9/54]

static MYSQL_SYSVAR_BOOL ( checkpoint_disabled  ,
srv_checkpoint_disabled  ,
PLUGIN_VAR_OPCMDARG  ,
"Disable checkpoints"  ,
NULL  ,
checkpoint_disabled_update  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [10/54]

static MYSQL_SYSVAR_BOOL ( buf_flush_list_now  ,
innodb_buf_flush_list_now  ,
PLUGIN_VAR_OPCMDARG  ,
"Force dirty page flush now"  ,
NULL  ,
buf_flush_list_now_set  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [11/54]

static MYSQL_SYSVAR_BOOL ( file_per_table  ,
srv_file_per_table  ,
PLUGIN_VAR_NOCMDARG  ,
"Stores each InnoDB table to an .ibd file in the database dir."  ,
NULL  ,
NULL  ,
TRUE   
)
static

◆ MYSQL_SYSVAR_BOOL() [12/54]

static MYSQL_SYSVAR_BOOL ( force_load_corrupted  ,
srv_load_corrupted  ,
PLUGIN_VAR_NOCMDARG|PLUGIN_VAR_READONLY PLUGIN_VAR_NOPERSIST,
"Force InnoDB to load metadata of corrupted table."  ,
NULL  ,
NULL  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [13/54]

static MYSQL_SYSVAR_BOOL ( adaptive_flushing  ,
srv_adaptive_flushing  ,
PLUGIN_VAR_NOCMDARG  ,
"Attempt flushing dirty pages to avoid IO bursts at checkpoints."  ,
NULL  ,
NULL  ,
TRUE   
)
static

◆ MYSQL_SYSVAR_BOOL() [14/54]

static MYSQL_SYSVAR_BOOL ( flush_sync  ,
srv_flush_sync  ,
PLUGIN_VAR_NOCMDARG  ,
"Allow IO bursts at the checkpoints ignoring io_capacity setting."  ,
NULL  ,
NULL  ,
TRUE   
)
static

◆ MYSQL_SYSVAR_BOOL() [15/54]

static MYSQL_SYSVAR_BOOL ( rollback_on_timeout  ,
innobase_rollback_on_timeout  ,
PLUGIN_VAR_OPCMDARG PLUGIN_VAR_READONLY,
"Roll back the complete transaction on lock wait " "  timeout,
for 4.x compatibility(disabled by default)"  ,
NULL  ,
NULL  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [16/54]

static MYSQL_SYSVAR_BOOL ( status_file  ,
innobase_create_status_file  ,
PLUGIN_VAR_OPCMDARG PLUGIN_VAR_NOSYSVAR,
"Enable SHOW ENGINE INNODB STATUS output in the innodb_status.<pid> file"  ,
NULL  ,
NULL  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [17/54]

static MYSQL_SYSVAR_BOOL ( stats_on_metadata  ,
innobase_stats_on_metadata  ,
PLUGIN_VAR_OPCMDARG  ,
"Enable statistics gathering for metadata commands such as" " SHOW TABLE STATUS for tables that use transient statistics (off by " "default)"  ,
NULL  ,
NULL  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [18/54]

static MYSQL_SYSVAR_BOOL ( stats_persistent  ,
srv_stats_persistent  ,
PLUGIN_VAR_OPCMDARG  ,
"InnoDB persistent statistics enabled for all tables unless overridden" " at table level"  ,
NULL  ,
NULL  ,
TRUE   
)
static

◆ MYSQL_SYSVAR_BOOL() [19/54]

static MYSQL_SYSVAR_BOOL ( stats_auto_recalc  ,
srv_stats_auto_recalc  ,
PLUGIN_VAR_OPCMDARG  ,
"InnoDB automatic recalculation of persistent statistics enabled for all" " tables unless overridden at table level (automatic recalculation is only" " done when InnoDB decides that the table has changed too much and needs a" " new statistics)"  ,
NULL  ,
NULL  ,
TRUE   
)
static

◆ MYSQL_SYSVAR_BOOL() [20/54]

static MYSQL_SYSVAR_BOOL ( adaptive_hash_index  ,
btr_search_enabled  ,
PLUGIN_VAR_OPCMDARG  ,
"Enable InnoDB adaptive hash index (enabled by default). " " Disable with --skip-innodb-adaptive-hash-index."  ,
NULL  ,
innodb_adaptive_hash_index_update  ,
true   
)
static

◆ MYSQL_SYSVAR_BOOL() [21/54]

static MYSQL_SYSVAR_BOOL ( log_compressed_pages  ,
page_zip_log_pages  ,
PLUGIN_VAR_OPCMDARG  ,
"Enables/disables the logging of entire compressed page images." " InnoDB logs the compressed pages to prevent corruption if" " the zlib compression algorithm changes." " When turned  OFF,
InnoDB will assume that the zlib" " compression algorithm doesn 't change."  ,
NULL  ,
NULL  ,
TRUE   
)
static

◆ MYSQL_SYSVAR_BOOL() [22/54]

static MYSQL_SYSVAR_BOOL ( dedicated_server  ,
srv_dedicated_server  ,
PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_NOPERSIST PLUGIN_VAR_READONLY,
"Automatically scale innodb_buffer_pool_size and innodb_log_file_size " "based on system memory. Also set  innodb_flush_method = O_DIRECT_NO_FSYNC,
" "if supported"  ,
NULL  ,
NULL  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [23/54]

static MYSQL_SYSVAR_BOOL ( buffer_pool_dump_now  ,
innodb_buffer_pool_dump_now  ,
PLUGIN_VAR_RQCMDARG  ,
"Trigger an immediate dump of the buffer pool into a " "file named @@innodb_buffer_pool_filename"  ,
NULL  ,
buffer_pool_dump_now  ,
FALSE   
)
static

◆ MYSQL_SYSVAR_BOOL() [24/54]

static MYSQL_SYSVAR_BOOL ( buffer_pool_dump_at_shutdown  ,
srv_buffer_pool_dump_at_shutdown  ,
PLUGIN_VAR_RQCMDARG  ,
"Dump the buffer pool into a file named @@innodb_buffer_pool_filename"  ,
NULL  ,
NULL  ,
TRUE   
)
static

◆ MYSQL_SYSVAR_BOOL() [25/54]

static MYSQL_SYSVAR_BOOL ( buffer_pool_in_core_file  ,
srv_buffer_pool_in_core_file  ,
PLUGIN_VAR_NOCMDARG  ,
"This option has no effect if @@core_file is OFF. " "If @@core_file is  ON,
and this option is  OFF,
then the core dump file will" " be generated only if it is possible to exclude buffer pool from it. " "As soon as it will be determined that such exclusion is impossible a " "warning will be emitted and @ @core_file will be set to OFF to prevent " "generating a core dump. " "If this option is   enabledwhich is the default,
then core dumping " "logic will not be affected. "  ,
NULL  ,
innodb_srv_buffer_pool_in_core_file_update  ,
TRUE   
)
static

◆ MYSQL_SYSVAR_BOOL() [26/54]

static MYSQL_SYSVAR_BOOL ( buffer_pool_load_now  ,
innodb_buffer_pool_load_now  ,
PLUGIN_VAR_RQCMDARG  ,
"Trigger an immediate load of the buffer pool from a " "file named @@innodb_buffer_pool_filename"  ,
NULL  ,
buffer_pool_load_now  ,