31#ifndef MYSQL_ABI_CHECK
50#if defined(MYSQL_DYNAMIC_PLUGIN)
52#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
54#define MYSQL_PLUGIN_EXPORT __declspec(dllexport)
58#define MYSQL_PLUGIN_EXPORT extern "C"
60#define MYSQL_PLUGIN_EXPORT
66#if defined(MYSQL_DYNAMIC_PLUGIN)
67#define MYSQL_PLUGIN_EXPORT MY_ATTRIBUTE((visibility("default")))
69#define MYSQL_PLUGIN_EXPORT
77#define MYSQL_THD THD *
79#define MYSQL_THD void *
84#ifndef MYSQL_ABI_CHECK
88#define MYSQL_XIDDATASIZE 128
108#define MYSQL_PLUGIN_INTERFACE_VERSION 0x010B
113#define MYSQL_UDF_PLUGIN 0
114#define MYSQL_STORAGE_ENGINE_PLUGIN 1
115#define MYSQL_FTPARSER_PLUGIN 2
116#define MYSQL_DAEMON_PLUGIN 3
117#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4
118#define MYSQL_AUDIT_PLUGIN 5
119#define MYSQL_REPLICATION_PLUGIN 6
120#define MYSQL_AUTHENTICATION_PLUGIN 7
121#define MYSQL_VALIDATE_PASSWORD_PLUGIN 8
122#define MYSQL_GROUP_REPLICATION_PLUGIN 9
123#define MYSQL_KEYRING_PLUGIN 10
124#define MYSQL_CLONE_PLUGIN 11
125#define MYSQL_MAX_PLUGIN_TYPE_NUM 12
128#define PLUGIN_LICENSE_PROPRIETARY 0
129#define PLUGIN_LICENSE_GPL 1
130#define PLUGIN_LICENSE_BSD 2
132#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY"
133#define PLUGIN_LICENSE_GPL_STRING "GPL"
134#define PLUGIN_LICENSE_BSD_STRING "BSD"
136#define PLUGIN_AUTHOR_ORACLE "Oracle Corporation"
144#ifndef MYSQL_DYNAMIC_PLUGIN
145#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
146 MYSQL_PLUGIN_EXPORT int VERSION = MYSQL_PLUGIN_INTERFACE_VERSION; \
147 MYSQL_PLUGIN_EXPORT int PSIZE = sizeof(struct st_mysql_plugin); \
148 MYSQL_PLUGIN_EXPORT struct st_mysql_plugin DECLS[] = {
150#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
151 MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_ = \
152 MYSQL_PLUGIN_INTERFACE_VERSION; \
153 MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_ = \
154 sizeof(struct st_mysql_plugin); \
155 MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[] = {
158#define mysql_declare_plugin(NAME) \
159 __MYSQL_DECLARE_PLUGIN(NAME, builtin_##NAME##_plugin_interface_version, \
160 builtin_##NAME##_sizeof_struct_st_plugin, \
161 builtin_##NAME##_plugin)
163#define mysql_declare_plugin_end \
164 , { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } \
171#define PLUGIN_OPT_NO_INSTALL 1UL
172#define PLUGIN_OPT_NO_UNINSTALL 2UL
173#define PLUGIN_OPT_ALLOW_EARLY 4UL
174#define PLUGIN_OPT_DEFAULT_OFF 8UL
186#define PLUGIN_OPT_DEPENDENT_EXTRA_PLUGINS 16UL
233 void *var_ptr,
const void *save);
237#define PLUGIN_VAR_MASK \
238 (PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT | \
239 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | \
240 PLUGIN_VAR_MEMALLOC | PLUGIN_VAR_NODEFAULT | PLUGIN_VAR_NOPERSIST | \
241 PLUGIN_VAR_PERSIST_AS_READ_ONLY | PLUGIN_VAR_INVISIBLE | \
242 PLUGIN_VAR_SENSITIVE)
244#define MYSQL_PLUGIN_VAR_HEADER \
247 const char *comment; \
248 mysql_var_check_func check; \
249 mysql_var_update_func update
251#define MYSQL_SYSVAR_NAME(name) mysql_sysvar_##name
252#define MYSQL_SYSVAR(name) ((SYS_VAR *)&(MYSQL_SYSVAR_NAME(name)))
261#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) \
263 MYSQL_PLUGIN_VAR_HEADER; \
265 const type def_val; \
266 } MYSQL_SYSVAR_NAME(name)
268#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) \
270 MYSQL_PLUGIN_VAR_HEADER; \
276 } MYSQL_SYSVAR_NAME(name)
278#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) \
280 MYSQL_PLUGIN_VAR_HEADER; \
284 } MYSQL_SYSVAR_NAME(name)
286#define DECLARE_THDVAR_FUNC(type) type *(*resolve)(MYSQL_THD thd, int offset)
288#define DECLARE_MYSQL_THDVAR_BASIC(name, type) \
290 MYSQL_PLUGIN_VAR_HEADER; \
292 const type def_val; \
293 DECLARE_THDVAR_FUNC(type); \
294 } MYSQL_SYSVAR_NAME(name)
296#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type) \
298 MYSQL_PLUGIN_VAR_HEADER; \
304 DECLARE_THDVAR_FUNC(type); \
305 } MYSQL_SYSVAR_NAME(name)
307#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) \
309 MYSQL_PLUGIN_VAR_HEADER; \
312 DECLARE_THDVAR_FUNC(type); \
314 } MYSQL_SYSVAR_NAME(name)
320#define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \
321 DECLARE_MYSQL_SYSVAR_BASIC(name, bool) = { \
322 PLUGIN_VAR_BOOL | ((opt)&PLUGIN_VAR_MASK), \
330#define MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) \
331 DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \
332 PLUGIN_VAR_STR | ((opt)&PLUGIN_VAR_MASK), \
340#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, \
342 DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \
343 PLUGIN_VAR_INT | ((opt)&PLUGIN_VAR_MASK), \
354#define MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, \
356 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \
357 PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
368#define MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, \
370 DECLARE_MYSQL_SYSVAR_SIMPLE(name, long) = { \
371 PLUGIN_VAR_LONG | ((opt)&PLUGIN_VAR_MASK), \
382#define MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, \
384 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \
385 PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
396#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, \
398 DECLARE_MYSQL_SYSVAR_SIMPLE(name, long long) = { \
399 PLUGIN_VAR_LONGLONG | ((opt)&PLUGIN_VAR_MASK), \
410#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, \
411 def, min, max, blk) \
412 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \
413 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
424#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, \
426 DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \
427 PLUGIN_VAR_ENUM | ((opt)&PLUGIN_VAR_MASK), \
436#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, \
438 DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \
439 PLUGIN_VAR_SET | ((opt)&PLUGIN_VAR_MASK), \
448#define MYSQL_SYSVAR_DOUBLE(name, varname, opt, comment, check, update, def, \
450 DECLARE_MYSQL_SYSVAR_SIMPLE(name, double) = { \
451 PLUGIN_VAR_DOUBLE | ((opt)&PLUGIN_VAR_MASK), \
462#define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \
463 DECLARE_MYSQL_THDVAR_BASIC(name, bool) = { \
464 PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
473#define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \
474 DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \
475 PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
484#define MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, \
486 DECLARE_MYSQL_THDVAR_SIMPLE(name, int) = { \
487 PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
499#define MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, \
501 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \
502 PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
503 ((opt)&PLUGIN_VAR_MASK), \
515#define MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, \
517 DECLARE_MYSQL_THDVAR_SIMPLE(name, long) = { \
518 PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
530#define MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, \
532 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \
533 PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
534 ((opt)&PLUGIN_VAR_MASK), \
546#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, \
548 DECLARE_MYSQL_THDVAR_SIMPLE(name, long long) = { \
549 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
561#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, \
563 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \
564 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
565 ((opt)&PLUGIN_VAR_MASK), \
577#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \
578 DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \
579 PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
589#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \
590 DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \
591 PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
601#define MYSQL_THDVAR_DOUBLE(name, opt, comment, check, update, def, min, max, \
603 DECLARE_MYSQL_THDVAR_SIMPLE(name, double) = { \
604 PLUGIN_VAR_DOUBLE | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
618#define SYSVAR(name) (*(MYSQL_SYSVAR_NAME(name).value))
621#define THDVAR(thd, name) \
622 (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset)))
624#define THDVAR_SET(thd, name, value) \
625 plugin_thdvar_safe_update(thd, MYSQL_SYSVAR(name), \
626 (char **)&THDVAR(thd, name), (const char *)value);
655#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0101
661#define MYSQL_REWRITE_PRE_PARSE_INTERFACE_VERSION 0x0010
662#define MYSQL_REWRITE_POST_PARSE_INTERFACE_VERSION 0x0010
669#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
685#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
701#define MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
718#define MYSQL_REPLICATION_INTERFACE_VERSION 0x0400
731#define thd_proc_info(thd, msg) \
732 set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
743 const char *calling_func,
744 const char *calling_file,
745 const unsigned int calling_line);
754 size_t max_query_len);
817 unsigned long long *pos_var);
862 const void *ha_data);
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:853
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
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.
Definition: sql_thd_api.cc:309
int thd_in_lock_tables(const MYSQL_THD thd)
Definition: sql_thd_api.cc:318
int thd_tx_is_read_only(const MYSQL_THD thd)
Definition: sql_thd_api.cc:406
unsigned long thd_get_thread_id(const MYSQL_THD thd)
Return the thread id of a user thread.
Definition: sql_thd_api.cc:563
int thd_allow_batch(MYSQL_THD thd)
Check if batching is allowed for the thread.
Definition: sql_thd_api.cc:574
#define MYSQL_THD
Definition: plugin.h:77
int thd_tx_is_dd_trx(const MYSQL_THD thd)
Definition: sql_thd_api.cc:423
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.
Definition: sql_thd_api.cc:470
int mysql_tmpfile(const char *prefix)
Create a temporary file.
Definition: sql_thd_api.cc:314
void thd_inc_row_count(MYSQL_THD thd)
Definition: sql_thd_api.cc:427
void remove_ssl_err_thread_state()
Interface to remove the per thread openssl error queue.
Definition: sql_thd_api.cc:697
int thd_sql_command(const MYSQL_THD thd)
Definition: sql_thd_api.cc:402
#define MYSQL_XIDDATASIZE
Definition: plugin.h:88
int thd_tx_priority(const MYSQL_THD thd)
Definition: sql_thd_api.cc:408
int thd_tx_isolation(const MYSQL_THD thd)
Definition: sql_thd_api.cc:404
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)
Definition: sql_thd_api.cc:351
int(* mysql_var_check_func)(MYSQL_THD thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
Definition: plugin.h:215
void * thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton)
Provide a handler data getter to simplify coding.
Definition: sql_thd_api.cc:378
void * MYSQL_PLUGIN
Definition: plugin.h:82
int thd_tablespace_op(const MYSQL_THD thd)
Definition: sql_thd_api.cc:320
int thd_killed(const void *v_thd)
Check the killed state of a connection.
Definition: sql_thd_api.cc:548
unsigned int thd_get_num_vcpus()
Interface to get the number of VCPUs.
Definition: sql_thd_api.cc:703
void thd_storage_lock_wait(MYSQL_THD thd, long long value)
Definition: sql_thd_api.cc:371
void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton, const void *ha_data)
Provide a handler data setter to simplify coding.
Definition: sql_thd_api.cc:386
void(* mysql_var_update_func)(MYSQL_THD thd, SYS_VAR *var, void *var_ptr, const void *save)
Definition: plugin.h:232
void thd_set_kill_status(const MYSQL_THD thd)
Set the killed status of the current statement.
Definition: sql_thd_api.cc:561
void ** thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton)
Definition: sql_thd_api.cc:367
void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid)
Get the XID for this connection's transaction.
Definition: sql_thd_api.cc:543
MYSQL_THD thd_tx_arbitrate(MYSQL_THD requestor, MYSQL_THD holder)
Definition: sql_thd_api.cc:412
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.
Definition: sql_thd_api.cc:581
long long thd_test_options(const MYSQL_THD thd, long long test_options)
Definition: sql_thd_api.cc:398
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:420
MYSQL_XID is binary compatible with the XID structure as in the X/Open CAE Specification,...
Definition: plugin.h:97
long bqual_length
Definition: plugin.h:100
char data[MYSQL_XIDDATASIZE]
Definition: plugin.h:101
long formatID
Definition: plugin.h:98
long gtrid_length
Definition: plugin.h:99
Replication plugin descriptor.
Definition: plugin.h:723
int interface_version
Definition: plugin.h:724
SHOW STATUS Server status variable.
Definition: status_var.h:79
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2622
int interface_version
Definition: plugin.h:677
unsigned int version
Definition: plugin.h:645
int type
Definition: plugin.h:633
SHOW_VAR * status_vars
Definition: plugin.h:646
int(* deinit)(MYSQL_PLUGIN)
Function to invoke when plugin is unloaded.
Definition: plugin.h:644
void * info
Definition: plugin.h:634
int(* check_uninstall)(MYSQL_PLUGIN)
Function to invoke when plugin is uninstalled.
Definition: plugin.h:642
unsigned long flags
Definition: plugin.h:649
int(* init)(MYSQL_PLUGIN)
Function to invoke when plugin is loaded.
Definition: plugin.h:640
const char * descr
Definition: plugin.h:637
const char * author
Definition: plugin.h:636
SYS_VAR ** system_vars
Definition: plugin.h:647
int license
Definition: plugin.h:638
void * __reserved1
Definition: plugin.h:648
const char * name
Definition: plugin.h:635
int interface_version
Definition: plugin.h:710
Definition: system_variables_bits.h:94
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:871