MySQL 8.0.39
Source Code Documentation
plugin.h File Reference
#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...
 

Macro Definition Documentation

◆ __MYSQL_DECLARE_PLUGIN

#define __MYSQL_DECLARE_PLUGIN (   NAME,
  VERSION,
  PSIZE,
  DECLS 
)
Value:
MYSQL_PLUGIN_EXPORT int PSIZE = sizeof(struct st_mysql_plugin); \
MYSQL_PLUGIN_EXPORT struct st_mysql_plugin DECLS[] = {
#define VERSION
Definition: config.h:306
#define MYSQL_PLUGIN_EXPORT
Definition: plugin.h:69
#define MYSQL_PLUGIN_INTERFACE_VERSION
Definition: plugin.h:108
Definition: plugin.h:632

◆ DECLARE_MYSQL_SYSVAR_BASIC

#define DECLARE_MYSQL_SYSVAR_BASIC (   name,
  type 
)
Value:
struct { \
MYSQL_PLUGIN_VAR_HEADER; \
type *value; \
const type def_val; \
#define MYSQL_SYSVAR_NAME(name)
Definition: plugin.h:251
required string type
Definition: replication_group_member_actions.proto:34
case opt name
Definition: sslopt-case.h:33

◆ DECLARE_MYSQL_SYSVAR_SIMPLE

#define DECLARE_MYSQL_SYSVAR_SIMPLE (   name,
  type 
)
Value:
struct { \
MYSQL_PLUGIN_VAR_HEADER; \
type *value; \
type def_val; \
type min_val; \
type max_val; \
type blk_sz; \

◆ DECLARE_MYSQL_SYSVAR_TYPELIB

#define DECLARE_MYSQL_SYSVAR_TYPELIB (   name,
  type 
)
Value:
struct { \
MYSQL_PLUGIN_VAR_HEADER; \
type *value; \
type def_val; \
TYPELIB *typelib; \

◆ DECLARE_MYSQL_THDVAR_BASIC

#define DECLARE_MYSQL_THDVAR_BASIC (   name,
  type 
)
Value:
struct { \
MYSQL_PLUGIN_VAR_HEADER; \
int offset; \
const type def_val; \
DECLARE_THDVAR_FUNC(type); \

◆ DECLARE_MYSQL_THDVAR_SIMPLE

#define DECLARE_MYSQL_THDVAR_SIMPLE (   name,
  type 
)
Value:
struct { \
MYSQL_PLUGIN_VAR_HEADER; \
int offset; \
type def_val; \
type min_val; \
type max_val; \
type blk_sz; \
DECLARE_THDVAR_FUNC(type); \

◆ DECLARE_MYSQL_THDVAR_TYPELIB

#define DECLARE_MYSQL_THDVAR_TYPELIB (   name,
  type 
)
Value:
struct { \
MYSQL_PLUGIN_VAR_HEADER; \
int offset; \
type def_val; \
DECLARE_THDVAR_FUNC(type); \
TYPELIB *typelib; \

◆ DECLARE_THDVAR_FUNC

#define DECLARE_THDVAR_FUNC (   type)    type *(*resolve)(MYSQL_THD thd, int offset)

◆ MYSQL_AUDIT_PLUGIN

#define MYSQL_AUDIT_PLUGIN   5 /* The Audit plugin type */

◆ MYSQL_AUTHENTICATION_PLUGIN

#define MYSQL_AUTHENTICATION_PLUGIN   7 /* The authentication plugin type */

◆ MYSQL_CLONE_PLUGIN

#define MYSQL_CLONE_PLUGIN   11 /* The Clone plugin type */

◆ MYSQL_DAEMON_INTERFACE_VERSION

#define MYSQL_DAEMON_INTERFACE_VERSION   (MYSQL_VERSION_ID << 8)

◆ MYSQL_DAEMON_PLUGIN

#define MYSQL_DAEMON_PLUGIN   3 /* The daemon/raw plugin type */

◆ mysql_declare_plugin

#define mysql_declare_plugin (   NAME)
Value:
__MYSQL_DECLARE_PLUGIN(NAME, builtin_##NAME##_plugin_interface_version, \
builtin_##NAME##_sizeof_struct_st_plugin, \
builtin_##NAME##_plugin)
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS)
Definition: plugin.h:145
#define NAME(f)
Definition: xcom_base.cc:4132

◆ mysql_declare_plugin_end

#define mysql_declare_plugin_end
Value:
, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } \
}

◆ MYSQL_FTPARSER_INTERFACE_VERSION

#define MYSQL_FTPARSER_INTERFACE_VERSION   0x0101

◆ MYSQL_FTPARSER_PLUGIN

#define MYSQL_FTPARSER_PLUGIN   2 /* Full-text parser plugin */

◆ MYSQL_GROUP_REPLICATION_PLUGIN

#define MYSQL_GROUP_REPLICATION_PLUGIN   9 /* The Group Replication plugin */

◆ MYSQL_HANDLERTON_INTERFACE_VERSION

#define MYSQL_HANDLERTON_INTERFACE_VERSION   (MYSQL_VERSION_ID << 8)

◆ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION

#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION   (MYSQL_VERSION_ID << 8)

◆ MYSQL_INFORMATION_SCHEMA_PLUGIN

#define MYSQL_INFORMATION_SCHEMA_PLUGIN   4 /* The I_S plugin type */

◆ MYSQL_KEYRING_PLUGIN

#define MYSQL_KEYRING_PLUGIN   10 /* The Keyring plugin type */

◆ MYSQL_MAX_PLUGIN_TYPE_NUM

#define MYSQL_MAX_PLUGIN_TYPE_NUM   12 /* The number of plugin types */

◆ MYSQL_PLUGIN_EXPORT

#define MYSQL_PLUGIN_EXPORT

◆ MYSQL_PLUGIN_INTERFACE_VERSION

#define MYSQL_PLUGIN_INTERFACE_VERSION   0x010B

◆ MYSQL_PLUGIN_VAR_HEADER

#define MYSQL_PLUGIN_VAR_HEADER
Value:
int flags; \
const char *name; \
const char *comment; \
mysql_var_check_func check; \
mysql_var_update_func update
static int flags[50]
Definition: hp_test1.cc:40
#define comment
Definition: lexyy.cc:959
static uint update
Definition: myisamlog.cc:91

◆ MYSQL_REPLICATION_INTERFACE_VERSION

#define MYSQL_REPLICATION_INTERFACE_VERSION   0x0400

◆ MYSQL_REPLICATION_PLUGIN

#define MYSQL_REPLICATION_PLUGIN   6 /* The replication plugin type */

◆ MYSQL_REWRITE_POST_PARSE_INTERFACE_VERSION

#define MYSQL_REWRITE_POST_PARSE_INTERFACE_VERSION   0x0010

◆ MYSQL_REWRITE_PRE_PARSE_INTERFACE_VERSION

#define MYSQL_REWRITE_PRE_PARSE_INTERFACE_VERSION   0x0010

◆ MYSQL_STORAGE_ENGINE_PLUGIN

#define MYSQL_STORAGE_ENGINE_PLUGIN   1 /* Storage Engine */

◆ MYSQL_SYSVAR

#define MYSQL_SYSVAR (   name)    ((SYS_VAR *)&(MYSQL_SYSVAR_NAME(name)))

◆ MYSQL_SYSVAR_BOOL

#define MYSQL_SYSVAR_BOOL (   name,
  varname,
  opt,
  comment,
  check,
  update,
  def 
)
Value:
PLUGIN_VAR_BOOL | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
&varname, \
def}
#define PLUGIN_VAR_MASK
Definition: plugin.h:237
#define DECLARE_MYSQL_SYSVAR_BASIC(name, type)
Definition: plugin.h:261

◆ MYSQL_SYSVAR_DOUBLE

#define MYSQL_SYSVAR_DOUBLE (   name,
  varname,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
PLUGIN_VAR_DOUBLE | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
&varname, \
def, \
min, \
max, \
blk}
#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type)
Definition: plugin.h:268

◆ MYSQL_SYSVAR_ENUM

#define MYSQL_SYSVAR_ENUM (   name,
  varname,
  opt,
  comment,
  check,
  update,
  def,
  typelib 
)
Value:
DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \
PLUGIN_VAR_ENUM | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
&varname, \
def, \
typelib}
#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type)
Definition: plugin.h:278

◆ MYSQL_SYSVAR_INT

#define MYSQL_SYSVAR_INT (   name,
  varname,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
PLUGIN_VAR_INT | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
&varname, \
def, \
min, \
max, \
blk}

◆ MYSQL_SYSVAR_LONG

#define MYSQL_SYSVAR_LONG (   name,
  varname,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
PLUGIN_VAR_LONG | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
&varname, \
def, \
min, \
max, \
blk}

◆ MYSQL_SYSVAR_LONGLONG

#define MYSQL_SYSVAR_LONGLONG (   name,
  varname,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
PLUGIN_VAR_LONGLONG | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
&varname, \
def, \
min, \
max, \
blk}

◆ MYSQL_SYSVAR_NAME

#define MYSQL_SYSVAR_NAME (   name)    mysql_sysvar_##name

◆ MYSQL_SYSVAR_SET

#define MYSQL_SYSVAR_SET (   name,
  varname,
  opt,
  comment,
  check,
  update,
  def,
  typelib 
)
Value:
DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \
PLUGIN_VAR_SET | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
&varname, \
def, \
typelib}

◆ MYSQL_SYSVAR_STR

#define MYSQL_SYSVAR_STR (   name,
  varname,
  opt,
  comment,
  check,
  update,
  def 
)
Value:
PLUGIN_VAR_STR | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
&varname, \
def}

◆ MYSQL_SYSVAR_UINT

#define MYSQL_SYSVAR_UINT (   name,
  varname,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \
PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
&varname, \
def, \
min, \
max, \
blk}
#define PLUGIN_VAR_UNSIGNED
The variable is unsigned.
Definition: system_variables_bits.h:63

◆ MYSQL_SYSVAR_ULONG

#define MYSQL_SYSVAR_ULONG (   name,
  varname,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \
PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
&varname, \
def, \
min, \
max, \
blk}

◆ MYSQL_SYSVAR_ULONGLONG

#define MYSQL_SYSVAR_ULONGLONG (   name,
  varname,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
&varname, \
def, \
min, \
max, \
blk}

◆ MYSQL_THD

#define MYSQL_THD   THD *

◆ MYSQL_THDVAR_BOOL

#define MYSQL_THDVAR_BOOL (   name,
  opt,
  comment,
  check,
  update,
  def 
)
Value:
PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
-1, \
def, \
NULL}
#define PLUGIN_VAR_THDLOCAL
Variable is per-connection.
Definition: system_variables_bits.h:64
#define DECLARE_MYSQL_THDVAR_BASIC(name, type)
Definition: plugin.h:288

◆ MYSQL_THDVAR_DOUBLE

#define MYSQL_THDVAR_DOUBLE (   name,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
PLUGIN_VAR_DOUBLE | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
-1, \
def, \
min, \
max, \
blk, \
NULL}
#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type)
Definition: plugin.h:296

◆ MYSQL_THDVAR_ENUM

#define MYSQL_THDVAR_ENUM (   name,
  opt,
  comment,
  check,
  update,
  def,
  typelib 
)
Value:
DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \
PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
-1, \
def, \
NULL, \
typelib}
#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type)
Definition: plugin.h:307

◆ MYSQL_THDVAR_INT

#define MYSQL_THDVAR_INT (   name,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
-1, \
def, \
min, \
max, \
blk, \
NULL}

◆ MYSQL_THDVAR_LONG

#define MYSQL_THDVAR_LONG (   name,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
-1, \
def, \
min, \
max, \
blk, \
NULL}

◆ MYSQL_THDVAR_LONGLONG

#define MYSQL_THDVAR_LONGLONG (   name,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
-1, \
def, \
min, \
max, \
blk, \
NULL}

◆ MYSQL_THDVAR_SET

#define MYSQL_THDVAR_SET (   name,
  opt,
  comment,
  check,
  update,
  def,
  typelib 
)
Value:
DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \
PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
-1, \
def, \
NULL, \
typelib}

◆ MYSQL_THDVAR_STR

#define MYSQL_THDVAR_STR (   name,
  opt,
  comment,
  check,
  update,
  def 
)
Value:
PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
-1, \
def, \
NULL}

◆ MYSQL_THDVAR_UINT

#define MYSQL_THDVAR_UINT (   name,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \
((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
-1, \
def, \
min, \
max, \
blk, \
NULL}

◆ MYSQL_THDVAR_ULONG

#define MYSQL_THDVAR_ULONG (   name,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \
PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
-1, \
def, \
min, \
max, \
blk, \
NULL}

◆ MYSQL_THDVAR_ULONGLONG

#define MYSQL_THDVAR_ULONGLONG (   name,
  opt,
  comment,
  check,
  update,
  def,
  min,
  max,
  blk 
)
Value:
DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
((opt)&PLUGIN_VAR_MASK), \
#name, \
comment, \
check, \
update, \
-1, \
def, \
min, \
max, \
blk, \
NULL}

◆ MYSQL_UDF_PLUGIN

#define MYSQL_UDF_PLUGIN   0 /* User-defined function */

◆ MYSQL_VALIDATE_PASSWORD_PLUGIN

#define MYSQL_VALIDATE_PASSWORD_PLUGIN   8 /* validate password plugin type */

◆ MYSQL_XIDDATASIZE

#define MYSQL_XIDDATASIZE   128

◆ PLUGIN_AUTHOR_ORACLE

#define PLUGIN_AUTHOR_ORACLE   "Oracle Corporation"

◆ PLUGIN_LICENSE_BSD

#define PLUGIN_LICENSE_BSD   2

◆ PLUGIN_LICENSE_BSD_STRING

#define PLUGIN_LICENSE_BSD_STRING   "BSD"

◆ PLUGIN_LICENSE_GPL

#define PLUGIN_LICENSE_GPL   1

◆ PLUGIN_LICENSE_GPL_STRING

#define PLUGIN_LICENSE_GPL_STRING   "GPL"

◆ PLUGIN_LICENSE_PROPRIETARY

#define PLUGIN_LICENSE_PROPRIETARY   0

◆ PLUGIN_LICENSE_PROPRIETARY_STRING

#define PLUGIN_LICENSE_PROPRIETARY_STRING   "PROPRIETARY"

◆ PLUGIN_OPT_ALLOW_EARLY

#define PLUGIN_OPT_ALLOW_EARLY   4UL /* allow --early-plugin-load */

◆ PLUGIN_OPT_DEFAULT_OFF

#define PLUGIN_OPT_DEFAULT_OFF   8UL /* Turned off by default */

◆ PLUGIN_OPT_DEPENDENT_EXTRA_PLUGINS

#define PLUGIN_OPT_DEPENDENT_EXTRA_PLUGINS   16UL

◆ PLUGIN_OPT_NO_INSTALL

#define PLUGIN_OPT_NO_INSTALL   1UL /* Not dynamically loadable */

◆ PLUGIN_OPT_NO_UNINSTALL

#define PLUGIN_OPT_NO_UNINSTALL   2UL /* Not dynamically unloadable */

◆ PLUGIN_VAR_MASK

#define PLUGIN_VAR_MASK
Value:
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | \
PLUGIN_VAR_MEMALLOC | PLUGIN_VAR_NODEFAULT | PLUGIN_VAR_NOPERSIST | \
PLUGIN_VAR_PERSIST_AS_READ_ONLY | PLUGIN_VAR_INVISIBLE | \
PLUGIN_VAR_SENSITIVE)
#define PLUGIN_VAR_OPCMDARG
Argument optional for cmd line.
Definition: system_variables_bits.h:70
#define PLUGIN_VAR_NOPERSIST
SET PERSIST_ONLY is prohibited for read only variables.
Definition: system_variables_bits.h:73
#define PLUGIN_VAR_RQCMDARG
Argument required for cmd line.
Definition: system_variables_bits.h:69
#define PLUGIN_VAR_READONLY
Server variable is read only.
Definition: system_variables_bits.h:65
#define PLUGIN_VAR_NOCMDOPT
Not a command line option.
Definition: system_variables_bits.h:67
#define PLUGIN_VAR_INVISIBLE
Variable should not be shown.
Definition: system_variables_bits.h:76
#define PLUGIN_VAR_NOSYSVAR
Not a server variable.
Definition: system_variables_bits.h:66
#define PLUGIN_VAR_NODEFAULT
SET DEFAULT is prohibited.
Definition: system_variables_bits.h:71

◆ SYSVAR

#define SYSVAR (   name)    (*(MYSQL_SYSVAR_NAME(name).value))

◆ thd_proc_info

#define thd_proc_info (   thd,
  msg 
)     set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)

◆ THDVAR

#define THDVAR (   thd,
  name 
)     (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset)))

◆ THDVAR_SET

#define THDVAR_SET (   thd,
  name,
  value 
)
Value:
(char **)&THDVAR(thd, name), (const char *)value);
#define MYSQL_SYSVAR(name)
Definition: plugin.h:252
#define THDVAR(thd, name)
Definition: plugin.h:621
void plugin_thdvar_safe_update(THD *thd, SYS_VAR *var, char **dest, const char *value)
Set value for a thread local variable.
Definition: sql_plugin.cc:3157

Typedef Documentation

◆ MYSQL_PLUGIN

typedef void* MYSQL_PLUGIN

◆ mysql_var_check_func

typedef int(* mysql_var_check_func) (MYSQL_THD thd, SYS_VAR *var, void *save, struct st_mysql_value *value)

◆ mysql_var_update_func

typedef void(* mysql_var_update_func) (MYSQL_THD thd, SYS_VAR *var, void *var_ptr, const void *save)

Function Documentation

◆ mysql_tmpfile()

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.

Parameters
prefixprefix for temporary file name
Return values
-1error
>=0 a file handle that can be passed to dup or my_close

◆ remove_ssl_err_thread_state()

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.

◆ set_thd_proc_info()

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 
)

◆ thd_allow_batch()

int thd_allow_batch ( MYSQL_THD  thd)

Check if batching is allowed for the thread.

Parameters
thduser thread
Return values
1batching allowed
0batching not allowed

◆ thd_binlog_pos()

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.

Note
The file variable will be set to a buffer holding the name of the file name currently, but this can change if a rotation occur. Copy the string if you want to retain it.
Parameters
thdUse thread connection handle
file_varPointer to variable that will hold the file name.
pos_varPointer to variable that will hold the file position.

◆ thd_get_ha_data()

void * thd_get_ha_data ( const MYSQL_THD  thd,
const struct handlerton hton 
)

Provide a handler data getter to simplify coding.

◆ thd_get_num_vcpus()

unsigned int thd_get_num_vcpus ( )

Interface to get the number of VCPUs.

◆ thd_get_thread_id()

unsigned long thd_get_thread_id ( const MYSQL_THD  thd)

Return the thread id of a user thread.

Parameters
thduser thread connection handle
Returns
thread id

◆ thd_get_xid()

void thd_get_xid ( const MYSQL_THD  thd,
MYSQL_XID xid 
)

Get the XID for this connection's transaction.

Parameters
thduser thread connection handle
xidlocation where identifier is stored

◆ thd_ha_data()

void ** thd_ha_data ( const MYSQL_THD  thd,
const struct handlerton hton 
)

◆ thd_in_lock_tables()

int thd_in_lock_tables ( const MYSQL_THD  thd)

◆ thd_inc_row_count()

void thd_inc_row_count ( MYSQL_THD  thd)

◆ thd_killed()

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.

Parameters
v_thduser thread connection handle
Return values
0the connection is active
1the connection has been killed

◆ thd_mark_transaction_to_rollback()

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.

Parameters
thduser thread connection handle
allif all != 0, rollback the main transaction

◆ thd_security_context()

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.

Parameters
thdthread context
bufferpointer to preferred result buffer
lengthlength of buffer
max_query_lenhow many chars of query to copy (0 for all)
Returns
Pointer to string

◆ thd_set_ha_data()

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().

See also
thd_set_ha_data() definition in plugin.h

◆ thd_set_kill_status()

void thd_set_kill_status ( const MYSQL_THD  thd)

Set the killed status of the current statement.

Parameters
thduser thread connection handle

◆ thd_sql_command()

int thd_sql_command ( const MYSQL_THD  thd)

◆ thd_storage_lock_wait()

void thd_storage_lock_wait ( MYSQL_THD  thd,
long long  value 
)

◆ thd_tablespace_op()

int thd_tablespace_op ( const MYSQL_THD  thd)

◆ thd_test_options()

long long thd_test_options ( const MYSQL_THD  thd,
long long  test_options 
)

◆ thd_tx_arbitrate()

MYSQL_THD thd_tx_arbitrate ( MYSQL_THD  requestor,
MYSQL_THD  holder 
)

◆ thd_tx_is_dd_trx()

int thd_tx_is_dd_trx ( const MYSQL_THD  thd)

◆ thd_tx_is_read_only()

int thd_tx_is_read_only ( const MYSQL_THD  thd)

◆ thd_tx_isolation()

int thd_tx_isolation ( const MYSQL_THD  thd)

◆ thd_tx_priority()

int thd_tx_priority ( const MYSQL_THD  thd)