MySQL  8.0.16
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>

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...
 
struct  st_mysql_value
 

Macros

#define MYSQL_PLUGIN_EXPORT
 
#define MYSQL_THD   THD *
 
#define MYSQL_XIDDATASIZE   128
 
#define MYSQL_PLUGIN_INTERFACE_VERSION   0x0109
 
#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 __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_VAR_BOOL   0x0001
 
#define PLUGIN_VAR_INT   0x0002
 
#define PLUGIN_VAR_LONG   0x0003
 
#define PLUGIN_VAR_LONGLONG   0x0004
 
#define PLUGIN_VAR_STR   0x0005
 
#define PLUGIN_VAR_ENUM   0x0006
 
#define PLUGIN_VAR_SET   0x0007
 
#define PLUGIN_VAR_DOUBLE   0x0008
 
#define PLUGIN_VAR_UNSIGNED   0x0080
 
#define PLUGIN_VAR_THDLOCAL   0x0100 /* Variable is per-connection */
 
#define PLUGIN_VAR_READONLY   0x0200 /* Server variable is read only */
 
#define PLUGIN_VAR_NOSYSVAR   0x0400 /* Configurable only by cmd-line */
 
#define PLUGIN_VAR_NOCMDOPT   0x0800 /* Not a command line option */
 
#define PLUGIN_VAR_NOCMDARG   0x1000 /* No argument for cmd line */
 
#define PLUGIN_VAR_RQCMDARG   0x0000 /* Argument required for cmd line */
 
#define PLUGIN_VAR_OPCMDARG   0x2000 /* Argument optional for cmd line */
 
#define PLUGIN_VAR_NODEFAULT   0x4000 /* SET DEFAULT is prohibited */
 
#define PLUGIN_VAR_MEMALLOC   0x8000 /* String needs memory allocated */
 
#define PLUGIN_VAR_NOPERSIST
 
#define PLUGIN_VAR_PERSIST_AS_READ_ONLY   0x20000
 There can be some variables which needs to be set before plugin is loaded but not after plugin is loaded. More...
 
#define PLUGIN_VAR_INVISIBLE   0x40000 /* Variable should not be shown */
 
#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 MYSQL_VALUE_TYPE_STRING   0
 
#define MYSQL_VALUE_TYPE_REAL   1
 
#define MYSQL_VALUE_TYPE_INT   2
 
#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...
 

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[] = {
Definition: plugin.h:635
#define MYSQL_PLUGIN_INTERFACE_VERSION
Definition: plugin.h:99
#define MYSQL_PLUGIN_EXPORT
Definition: plugin.h:62
#define VERSION
Definition: config.h:168

◆ DECLARE_MYSQL_SYSVAR_BASIC

#define DECLARE_MYSQL_SYSVAR_BASIC (   name,
  type 
)
Value:
struct { \
MYSQL_PLUGIN_VAR_HEADER; \
type *value; \
const type def_val; \
int type
Definition: plugin.h:636
const string name("\ame\)
#define MYSQL_SYSVAR_NAME(name)
Definition: plugin.h:254
const string value("\alue\)

◆ 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; \
const string name("\ame\)
#define MYSQL_SYSVAR_NAME(name)
Definition: plugin.h:254
const string value("\alue\)

◆ DECLARE_MYSQL_SYSVAR_TYPELIB

#define DECLARE_MYSQL_SYSVAR_TYPELIB (   name,
  type 
)
Value:
struct { \
MYSQL_PLUGIN_VAR_HEADER; \
type *value; \
type def_val; \
TYPELIB *typelib; \
const string name("\ame\)
#define MYSQL_SYSVAR_NAME(name)
Definition: plugin.h:254
const string value("\alue\)

◆ 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); \
const string name("\ame\)
int type
Definition: http_common.h:411
#define MYSQL_SYSVAR_NAME(name)
Definition: plugin.h:254

◆ 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); \
const string name("\ame\)
int type
Definition: http_common.h:411
#define MYSQL_SYSVAR_NAME(name)
Definition: plugin.h:254

◆ 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; \
const string name("\ame\)
int type
Definition: http_common.h:411
#define MYSQL_SYSVAR_NAME(name)
Definition: plugin.h:254

◆ 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:134

◆ 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   0x0109

◆ 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
const string name("\ame\)
static uint update
Definition: myisamlog.cc:88
static int flags[50]
Definition: hp_test1.cc:39
#define comment
Definition: lexyy.cc:959

◆ 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}
const string name("\ame\)
#define DECLARE_MYSQL_SYSVAR_BASIC(name, type)
Definition: plugin.h:264
#define PLUGIN_VAR_MASK
Definition: plugin.h:241

◆ 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:271
const string name("\ame\)
#define PLUGIN_VAR_MASK
Definition: plugin.h:241

◆ 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}
const string name("\ame\)
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type)
Definition: plugin.h:281

◆ 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}
#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type)
Definition: plugin.h:271
const string name("\ame\)
#define PLUGIN_VAR_MASK
Definition: plugin.h:241

◆ 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}
#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type)
Definition: plugin.h:271
const string name("\ame\)
#define PLUGIN_VAR_MASK
Definition: plugin.h:241

◆ 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}
#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type)
Definition: plugin.h:271
const string name("\ame\)
#define PLUGIN_VAR_MASK
Definition: plugin.h:241

◆ 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}
const string name("\ame\)
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type)
Definition: plugin.h:281

◆ 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}
const string name("\ame\)
#define DECLARE_MYSQL_SYSVAR_BASIC(name, type)
Definition: plugin.h:264
#define PLUGIN_VAR_MASK
Definition: plugin.h:241

◆ 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 DECLARE_MYSQL_SYSVAR_SIMPLE(name, type)
Definition: plugin.h:271
const string name("\ame\)
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define PLUGIN_VAR_UNSIGNED
Definition: plugin.h:175

◆ 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}
#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type)
Definition: plugin.h:271
const string name("\ame\)
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define PLUGIN_VAR_UNSIGNED
Definition: plugin.h:175

◆ 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}
#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type)
Definition: plugin.h:271
const string name("\ame\)
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define PLUGIN_VAR_UNSIGNED
Definition: plugin.h:175

◆ 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}
const string name("\ame\)
#define PLUGIN_VAR_THDLOCAL
Definition: plugin.h:176
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define DECLARE_MYSQL_THDVAR_BASIC(name, type)
Definition: plugin.h:291

◆ 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}
const string name("\ame\)
#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type)
Definition: plugin.h:299
#define PLUGIN_VAR_THDLOCAL
Definition: plugin.h:176
#define PLUGIN_VAR_MASK
Definition: plugin.h:241

◆ 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}
const string name("\ame\)
#define PLUGIN_VAR_THDLOCAL
Definition: plugin.h:176
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type)
Definition: plugin.h:310

◆ 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}
const string name("\ame\)
#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type)
Definition: plugin.h:299
#define PLUGIN_VAR_THDLOCAL
Definition: plugin.h:176
#define PLUGIN_VAR_MASK
Definition: plugin.h:241

◆ 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}
const string name("\ame\)
#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type)
Definition: plugin.h:299
#define PLUGIN_VAR_THDLOCAL
Definition: plugin.h:176
#define PLUGIN_VAR_MASK
Definition: plugin.h:241

◆ 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}
const string name("\ame\)
#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type)
Definition: plugin.h:299
#define PLUGIN_VAR_THDLOCAL
Definition: plugin.h:176
#define PLUGIN_VAR_MASK
Definition: plugin.h:241

◆ 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}
const string name("\ame\)
#define PLUGIN_VAR_THDLOCAL
Definition: plugin.h:176
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type)
Definition: plugin.h:310

◆ 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}
const string name("\ame\)
#define PLUGIN_VAR_THDLOCAL
Definition: plugin.h:176
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define DECLARE_MYSQL_THDVAR_BASIC(name, type)
Definition: plugin.h:291

◆ 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}
const string name("\ame\)
#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type)
Definition: plugin.h:299
#define PLUGIN_VAR_THDLOCAL
Definition: plugin.h:176
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define PLUGIN_VAR_UNSIGNED
Definition: plugin.h:175

◆ 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}
const string name("\ame\)
#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type)
Definition: plugin.h:299
#define PLUGIN_VAR_THDLOCAL
Definition: plugin.h:176
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define PLUGIN_VAR_UNSIGNED
Definition: plugin.h:175

◆ 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}
const string name("\ame\)
#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type)
Definition: plugin.h:299
#define PLUGIN_VAR_THDLOCAL
Definition: plugin.h:176
#define PLUGIN_VAR_MASK
Definition: plugin.h:241
#define PLUGIN_VAR_UNSIGNED
Definition: plugin.h:175

◆ 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_VALUE_TYPE_INT

#define MYSQL_VALUE_TYPE_INT   2

◆ MYSQL_VALUE_TYPE_REAL

#define MYSQL_VALUE_TYPE_REAL   1

◆ MYSQL_VALUE_TYPE_STRING

#define MYSQL_VALUE_TYPE_STRING   0

◆ MYSQL_XIDDATASIZE

#define MYSQL_XIDDATASIZE   128

◆ 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_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_BOOL

#define PLUGIN_VAR_BOOL   0x0001

◆ PLUGIN_VAR_DOUBLE

#define PLUGIN_VAR_DOUBLE   0x0008

◆ PLUGIN_VAR_ENUM

#define PLUGIN_VAR_ENUM   0x0006

◆ PLUGIN_VAR_INT

#define PLUGIN_VAR_INT   0x0002

◆ PLUGIN_VAR_INVISIBLE

#define PLUGIN_VAR_INVISIBLE   0x40000 /* Variable should not be shown */

◆ PLUGIN_VAR_LONG

#define PLUGIN_VAR_LONG   0x0003

◆ PLUGIN_VAR_LONGLONG

#define PLUGIN_VAR_LONGLONG   0x0004

◆ 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)
#define PLUGIN_VAR_OPCMDARG
Definition: plugin.h:182
#define PLUGIN_VAR_NOPERSIST
Definition: plugin.h:185
#define PLUGIN_VAR_RQCMDARG
Definition: plugin.h:181
#define PLUGIN_VAR_NOSYSVAR
Definition: plugin.h:178
#define PLUGIN_VAR_READONLY
Definition: plugin.h:177
#define PLUGIN_VAR_NOCMDOPT
Definition: plugin.h:179
#define PLUGIN_VAR_NODEFAULT
Definition: plugin.h:183
#define PLUGIN_VAR_INVISIBLE
Definition: plugin.h:195

◆ PLUGIN_VAR_MEMALLOC

#define PLUGIN_VAR_MEMALLOC   0x8000 /* String needs memory allocated */

◆ PLUGIN_VAR_NOCMDARG

#define PLUGIN_VAR_NOCMDARG   0x1000 /* No argument for cmd line */

◆ PLUGIN_VAR_NOCMDOPT

#define PLUGIN_VAR_NOCMDOPT   0x0800 /* Not a command line option */

◆ PLUGIN_VAR_NODEFAULT

#define PLUGIN_VAR_NODEFAULT   0x4000 /* SET DEFAULT is prohibited */

◆ PLUGIN_VAR_NOPERSIST

#define PLUGIN_VAR_NOPERSIST
Value:
0x10000 /* SET PERSIST_ONLY is prohibited \
for read only variables */

◆ PLUGIN_VAR_NOSYSVAR

#define PLUGIN_VAR_NOSYSVAR   0x0400 /* Configurable only by cmd-line */

◆ PLUGIN_VAR_OPCMDARG

#define PLUGIN_VAR_OPCMDARG   0x2000 /* Argument optional for cmd line */

◆ PLUGIN_VAR_PERSIST_AS_READ_ONLY

#define PLUGIN_VAR_PERSIST_AS_READ_ONLY   0x20000

There can be some variables which needs to be set before plugin is loaded but not after plugin is loaded.

ex: GR specific variables. Below flag must be set for these kind of variables.

◆ PLUGIN_VAR_READONLY

#define PLUGIN_VAR_READONLY   0x0200 /* Server variable is read only */

◆ PLUGIN_VAR_RQCMDARG

#define PLUGIN_VAR_RQCMDARG   0x0000 /* Argument required for cmd line */

◆ PLUGIN_VAR_SET

#define PLUGIN_VAR_SET   0x0007

◆ PLUGIN_VAR_STR

#define PLUGIN_VAR_STR   0x0005

◆ PLUGIN_VAR_THDLOCAL

#define PLUGIN_VAR_THDLOCAL   0x0100 /* Variable is per-connection */

◆ PLUGIN_VAR_UNSIGNED

#define PLUGIN_VAR_UNSIGNED   0x0080

◆ 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);
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:2976
const string name("\ame\)
#define MYSQL_SYSVAR(name)
Definition: plugin.h:255
#define THDVAR(thd, name)
Definition: plugin.h:624
const string value("\alue\)

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_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
Parameters
thduser thread
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

Check the killed state of a connection.

Parameters
v_thduser thread
Return values
0the user thread is active
1the user thread 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)