MySQL 8.4.2
Source Code Documentation
|
#include <stddef.h>
#include "mysql_version.h"
#include "sql/sql_plugin.h"
#include "status_var.h"
#include <mysql/services.h>
#include <mysql/components/services/bits/system_variables_bits.h>
Go to the source code of this file.
Classes | |
struct | MYSQL_XID |
MYSQL_XID is binary compatible with the XID structure as in the X/Open CAE Specification, Distributed Transaction Processing: The XA Specification, X/Open Company Ltd., 1991. More... | |
struct | st_mysql_plugin |
struct | st_mysql_daemon |
struct | st_mysql_information_schema |
struct | st_mysql_storage_engine |
struct | Mysql_replication |
Replication plugin descriptor. More... | |
Macros | |
#define | MYSQL_PLUGIN_EXPORT |
#define | MYSQL_THD THD * |
#define | MYSQL_XIDDATASIZE 128 |
#define | MYSQL_PLUGIN_INTERFACE_VERSION 0x010B |
#define | MYSQL_UDF_PLUGIN 0 /* User-defined function */ |
#define | MYSQL_STORAGE_ENGINE_PLUGIN 1 /* Storage Engine */ |
#define | MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */ |
#define | MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */ |
#define | MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */ |
#define | MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */ |
#define | MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */ |
#define | MYSQL_AUTHENTICATION_PLUGIN 7 /* The authentication plugin type */ |
#define | MYSQL_VALIDATE_PASSWORD_PLUGIN 8 /* validate password plugin type */ |
#define | MYSQL_GROUP_REPLICATION_PLUGIN 9 /* The Group Replication plugin */ |
#define | MYSQL_KEYRING_PLUGIN 10 /* The Keyring plugin type */ |
#define | MYSQL_CLONE_PLUGIN 11 /* The Clone plugin type */ |
#define | MYSQL_MAX_PLUGIN_TYPE_NUM 12 /* The number of plugin types */ |
#define | PLUGIN_LICENSE_PROPRIETARY 0 |
#define | PLUGIN_LICENSE_GPL 1 |
#define | PLUGIN_LICENSE_BSD 2 |
#define | PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY" |
#define | PLUGIN_LICENSE_GPL_STRING "GPL" |
#define | PLUGIN_LICENSE_BSD_STRING "BSD" |
#define | PLUGIN_AUTHOR_ORACLE "Oracle Corporation" |
#define | __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) |
#define | mysql_declare_plugin(NAME) |
#define | mysql_declare_plugin_end |
#define | PLUGIN_OPT_NO_INSTALL 1UL /* Not dynamically loadable */ |
#define | PLUGIN_OPT_NO_UNINSTALL 2UL /* Not dynamically unloadable */ |
#define | PLUGIN_OPT_ALLOW_EARLY 4UL /* allow --early-plugin-load */ |
#define | PLUGIN_OPT_DEFAULT_OFF 8UL /* Turned off by default */ |
#define | PLUGIN_OPT_DEPENDENT_EXTRA_PLUGINS 16UL |
#define | PLUGIN_VAR_MASK |
#define | MYSQL_PLUGIN_VAR_HEADER |
#define | MYSQL_SYSVAR_NAME(name) mysql_sysvar_##name |
#define | MYSQL_SYSVAR(name) ((SYS_VAR *)&(MYSQL_SYSVAR_NAME(name))) |
#define | DECLARE_MYSQL_SYSVAR_BASIC(name, type) |
#define | DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) |
#define | DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) |
#define | DECLARE_THDVAR_FUNC(type) type *(*resolve)(MYSQL_THD thd, int offset) |
#define | DECLARE_MYSQL_THDVAR_BASIC(name, type) |
#define | DECLARE_MYSQL_THDVAR_SIMPLE(name, type) |
#define | DECLARE_MYSQL_THDVAR_TYPELIB(name, type) |
#define | MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) |
#define | MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) |
#define | MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) |
#define | MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, typelib) |
#define | MYSQL_SYSVAR_DOUBLE(name, varname, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) |
#define | MYSQL_THDVAR_STR(name, opt, comment, check, update, def) |
#define | MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) |
#define | MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) |
#define | MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) |
#define | MYSQL_THDVAR_DOUBLE(name, opt, comment, check, update, def, min, max, blk) |
#define | SYSVAR(name) (*(MYSQL_SYSVAR_NAME(name).value)) |
#define | THDVAR(thd, name) (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset))) |
#define | THDVAR_SET(thd, name, value) |
#define | MYSQL_FTPARSER_INTERFACE_VERSION 0x0101 |
#define | MYSQL_REWRITE_PRE_PARSE_INTERFACE_VERSION 0x0010 |
#define | MYSQL_REWRITE_POST_PARSE_INTERFACE_VERSION 0x0010 |
#define | MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) |
#define | MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) |
#define | MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) |
#define | MYSQL_REPLICATION_INTERFACE_VERSION 0x0400 |
#define | thd_proc_info(thd, msg) set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__) |
Typedefs | |
typedef void * | MYSQL_PLUGIN |
typedef int(* | mysql_var_check_func) (MYSQL_THD thd, SYS_VAR *var, void *save, struct st_mysql_value *value) |
typedef void(* | mysql_var_update_func) (MYSQL_THD thd, SYS_VAR *var, void *var_ptr, const void *save) |
Functions | |
int | thd_in_lock_tables (const MYSQL_THD thd) |
int | thd_tablespace_op (const MYSQL_THD thd) |
long long | thd_test_options (const MYSQL_THD thd, long long test_options) |
int | thd_sql_command (const MYSQL_THD thd) |
const char * | set_thd_proc_info (MYSQL_THD thd, const char *info, const char *calling_func, const char *calling_file, const unsigned int calling_line) |
void ** | thd_ha_data (const MYSQL_THD thd, const struct handlerton *hton) |
void | thd_storage_lock_wait (MYSQL_THD thd, long long value) |
int | thd_tx_isolation (const MYSQL_THD thd) |
int | thd_tx_is_read_only (const MYSQL_THD thd) |
MYSQL_THD | thd_tx_arbitrate (MYSQL_THD requestor, MYSQL_THD holder) |
int | thd_tx_priority (const MYSQL_THD thd) |
int | thd_tx_is_dd_trx (const MYSQL_THD thd) |
char * | thd_security_context (MYSQL_THD thd, char *buffer, size_t length, size_t max_query_len) |
Dumps a text description of a thread, its security context (user, host) and the current query. More... | |
void | thd_inc_row_count (MYSQL_THD thd) |
int | thd_allow_batch (MYSQL_THD thd) |
Check if batching is allowed for the thread. More... | |
void | thd_mark_transaction_to_rollback (MYSQL_THD thd, int all) |
Mark transaction to rollback and mark error as fatal to a sub-statement if in sub statement mode. More... | |
int | mysql_tmpfile (const char *prefix) |
Create a temporary file. More... | |
int | thd_killed (const void *v_thd) |
Check the killed state of a connection. More... | |
void | thd_set_kill_status (const MYSQL_THD thd) |
Set the killed status of the current statement. More... | |
void | thd_binlog_pos (const MYSQL_THD thd, const char **file_var, unsigned long long *pos_var) |
Get binary log position for latest written entry. More... | |
unsigned long | thd_get_thread_id (const MYSQL_THD thd) |
Return the thread id of a user thread. More... | |
void | thd_get_xid (const MYSQL_THD thd, MYSQL_XID *xid) |
Get the XID for this connection's transaction. More... | |
void * | thd_get_ha_data (const MYSQL_THD thd, const struct handlerton *hton) |
Provide a handler data getter to simplify coding. More... | |
void | thd_set_ha_data (MYSQL_THD thd, const struct handlerton *hton, const void *ha_data) |
Provide a handler data setter to simplify coding. More... | |
void | remove_ssl_err_thread_state () |
Interface to remove the per thread openssl error queue. More... | |
unsigned int | thd_get_num_vcpus () |
Interface to get the number of VCPUs. More... | |
#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */ |
#define MYSQL_AUTHENTICATION_PLUGIN 7 /* The authentication plugin type */ |
#define MYSQL_CLONE_PLUGIN 11 /* The Clone plugin type */ |
#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) |
#define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */ |
#define mysql_declare_plugin | ( | NAME | ) |
#define mysql_declare_plugin_end |
#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0101 |
#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */ |
#define MYSQL_GROUP_REPLICATION_PLUGIN 9 /* The Group Replication plugin */ |
#define MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) |
#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) |
#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */ |
#define MYSQL_KEYRING_PLUGIN 10 /* The Keyring plugin type */ |
#define MYSQL_MAX_PLUGIN_TYPE_NUM 12 /* The number of plugin types */ |
#define MYSQL_PLUGIN_EXPORT |
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x010B |
#define MYSQL_PLUGIN_VAR_HEADER |
#define MYSQL_REPLICATION_INTERFACE_VERSION 0x0400 |
#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */ |
#define MYSQL_REWRITE_POST_PARSE_INTERFACE_VERSION 0x0010 |
#define MYSQL_REWRITE_PRE_PARSE_INTERFACE_VERSION 0x0010 |
#define MYSQL_STORAGE_ENGINE_PLUGIN 1 /* Storage Engine */ |
#define MYSQL_SYSVAR | ( | name | ) | ((SYS_VAR *)&(MYSQL_SYSVAR_NAME(name))) |
#define MYSQL_THD THD * |
#define MYSQL_UDF_PLUGIN 0 /* User-defined function */ |
#define MYSQL_XIDDATASIZE 128 |
#define PLUGIN_AUTHOR_ORACLE "Oracle Corporation" |
#define PLUGIN_LICENSE_BSD 2 |
#define PLUGIN_LICENSE_BSD_STRING "BSD" |
#define PLUGIN_LICENSE_GPL 1 |
#define PLUGIN_LICENSE_GPL_STRING "GPL" |
#define PLUGIN_LICENSE_PROPRIETARY 0 |
#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY" |
#define PLUGIN_OPT_ALLOW_EARLY 4UL /* allow --early-plugin-load */ |
#define PLUGIN_OPT_DEFAULT_OFF 8UL /* Turned off by default */ |
#define PLUGIN_OPT_DEPENDENT_EXTRA_PLUGINS 16UL |
#define PLUGIN_OPT_NO_INSTALL 1UL /* Not dynamically loadable */ |
#define PLUGIN_OPT_NO_UNINSTALL 2UL /* Not dynamically unloadable */ |
#define PLUGIN_VAR_MASK |
#define SYSVAR | ( | name | ) | (*(MYSQL_SYSVAR_NAME(name).value)) |
#define thd_proc_info | ( | thd, | |
msg | |||
) | set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__) |
#define THDVAR | ( | thd, | |
name | |||
) | (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset))) |
#define THDVAR_SET | ( | thd, | |
name, | |||
value | |||
) |
typedef void* MYSQL_PLUGIN |
typedef int(* mysql_var_check_func) (MYSQL_THD thd, SYS_VAR *var, void *save, struct st_mysql_value *value) |
typedef void(* mysql_var_update_func) (MYSQL_THD thd, SYS_VAR *var, void *var_ptr, const void *save) |
int mysql_tmpfile | ( | const char * | prefix | ) |
Create a temporary file.
The temporary file is created in a location specified by the mysql server configuration (–tmpdir option). The caller does not need to delete the file, it will be deleted automatically.
prefix | prefix for temporary file name |
-1 | error |
>= | 0 a file handle that can be passed to dup or my_close |
void remove_ssl_err_thread_state | ( | ) |
Interface to remove the per thread openssl error queue.
This function is a no-op when openssl is not used.
Interface to remove the per thread openssl error queue.
const char * set_thd_proc_info | ( | MYSQL_THD | thd, |
const char * | info, | ||
const char * | calling_func, | ||
const char * | calling_file, | ||
const unsigned int | calling_line | ||
) |
int thd_allow_batch | ( | MYSQL_THD | thd | ) |
Check if batching is allowed for the thread.
thd | user thread |
1 | batching allowed |
0 | batching not allowed |
void thd_binlog_pos | ( | const MYSQL_THD | thd, |
const char ** | file_var, | ||
unsigned long long * | pos_var | ||
) |
Get binary log position for latest written entry.
thd | Use thread connection handle |
file_var | Pointer to variable that will hold the file name. |
pos_var | Pointer to variable that will hold the file position. |
void * thd_get_ha_data | ( | const MYSQL_THD | thd, |
const struct handlerton * | hton | ||
) |
Provide a handler data getter to simplify coding.
unsigned int thd_get_num_vcpus | ( | ) |
Interface to get the number of VCPUs.
unsigned long thd_get_thread_id | ( | const MYSQL_THD | thd | ) |
Return the thread id of a user thread.
thd | user thread connection handle |
Get the XID for this connection's transaction.
thd | user thread connection handle |
xid | location where identifier is stored |
void ** thd_ha_data | ( | const MYSQL_THD | thd, |
const struct handlerton * | hton | ||
) |
int thd_in_lock_tables | ( | const MYSQL_THD | thd | ) |
void thd_inc_row_count | ( | MYSQL_THD | thd | ) |
int thd_killed | ( | const void * | v_thd | ) |
Check the killed state of a connection.
In MySQL support for the KILL statement is cooperative. The KILL statement only sets a "killed" flag. This function returns the value of that flag. A thread should check it often, especially inside time-consuming loops, and gracefully abort the operation if it is non-zero.
v_thd | user thread connection handle |
0 | the connection is active |
1 | the connection has been killed |
void thd_mark_transaction_to_rollback | ( | MYSQL_THD | thd, |
int | all | ||
) |
Mark transaction to rollback and mark error as fatal to a sub-statement if in sub statement mode.
thd | user thread connection handle |
all | if all != 0, rollback the main transaction |
char * thd_security_context | ( | MYSQL_THD | thd, |
char * | buffer, | ||
size_t | length, | ||
size_t | max_query_len | ||
) |
Dumps a text description of a thread, its security context (user, host) and the current query.
thd | thread context |
buffer | pointer to preferred result buffer |
length | length of buffer |
max_query_len | how many chars of query to copy (0 for all) |
void thd_set_ha_data | ( | MYSQL_THD | thd, |
const struct handlerton * | hton, | ||
const void * | ha_data | ||
) |
Provide a handler data setter to simplify coding.
Set ha_data pointer (storage engine per-connection information).
To avoid unclean deactivation (uninstall) of storage engine plugin in the middle of transaction, additional storage engine plugin lock is acquired.
If ha_data is not null and storage engine plugin was not locked by thd_set_ha_data() in this connection before, storage engine plugin gets locked.
If ha_data is null and storage engine plugin was locked by thd_set_ha_data() in this connection before, storage engine plugin lock gets released.
If handlerton::close_connection() didn't reset ha_data, server does it immediately after calling handlerton::close_connection().
void thd_set_kill_status | ( | const MYSQL_THD | thd | ) |
Set the killed status of the current statement.
thd | user thread connection handle |
int thd_sql_command | ( | const MYSQL_THD | thd | ) |
void thd_storage_lock_wait | ( | MYSQL_THD | thd, |
long long | value | ||
) |
int thd_tablespace_op | ( | const MYSQL_THD | thd | ) |
long long thd_test_options | ( | const MYSQL_THD | thd, |
long long | test_options | ||
) |
int thd_tx_is_dd_trx | ( | const MYSQL_THD | thd | ) |
int thd_tx_is_read_only | ( | const MYSQL_THD | thd | ) |
int thd_tx_isolation | ( | const MYSQL_THD | thd | ) |
int thd_tx_priority | ( | const MYSQL_THD | thd | ) |