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 \
165 0, nullptr, nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr, 0, \
166 nullptr, nullptr, nullptr, 0 \
174#define PLUGIN_OPT_NO_INSTALL 1UL
175#define PLUGIN_OPT_NO_UNINSTALL 2UL
176#define PLUGIN_OPT_ALLOW_EARLY 4UL
177#define PLUGIN_OPT_DEFAULT_OFF 8UL
189#define PLUGIN_OPT_DEPENDENT_EXTRA_PLUGINS 16UL
236 void *var_ptr,
const void *save);
240#define PLUGIN_VAR_MASK \
241 (PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT | \
242 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | \
243 PLUGIN_VAR_MEMALLOC | PLUGIN_VAR_NODEFAULT | PLUGIN_VAR_NOPERSIST | \
244 PLUGIN_VAR_PERSIST_AS_READ_ONLY | PLUGIN_VAR_INVISIBLE | \
245 PLUGIN_VAR_SENSITIVE)
247#define MYSQL_PLUGIN_VAR_HEADER \
250 const char *comment; \
251 mysql_var_check_func check; \
252 mysql_var_update_func update
254#define MYSQL_SYSVAR_NAME(name) mysql_sysvar_##name
255#define MYSQL_SYSVAR(name) ((SYS_VAR *)&(MYSQL_SYSVAR_NAME(name)))
264#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) \
266 MYSQL_PLUGIN_VAR_HEADER; \
268 const type def_val; \
269 } MYSQL_SYSVAR_NAME(name)
271#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) \
273 MYSQL_PLUGIN_VAR_HEADER; \
279 } MYSQL_SYSVAR_NAME(name)
281#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) \
283 MYSQL_PLUGIN_VAR_HEADER; \
287 } MYSQL_SYSVAR_NAME(name)
289#define DECLARE_THDVAR_FUNC(type) type *(*resolve)(MYSQL_THD thd, int offset)
291#define DECLARE_MYSQL_THDVAR_BASIC(name, type) \
293 MYSQL_PLUGIN_VAR_HEADER; \
295 const type def_val; \
296 DECLARE_THDVAR_FUNC(type); \
297 } MYSQL_SYSVAR_NAME(name)
299#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type) \
301 MYSQL_PLUGIN_VAR_HEADER; \
307 DECLARE_THDVAR_FUNC(type); \
308 } MYSQL_SYSVAR_NAME(name)
310#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) \
312 MYSQL_PLUGIN_VAR_HEADER; \
315 DECLARE_THDVAR_FUNC(type); \
317 } MYSQL_SYSVAR_NAME(name)
323#define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \
324 DECLARE_MYSQL_SYSVAR_BASIC(name, bool) = { \
325 PLUGIN_VAR_BOOL | ((opt)&PLUGIN_VAR_MASK), \
333#define MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) \
334 DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \
335 PLUGIN_VAR_STR | ((opt)&PLUGIN_VAR_MASK), \
343#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, \
345 DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \
346 PLUGIN_VAR_INT | ((opt)&PLUGIN_VAR_MASK), \
357#define MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, \
359 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \
360 PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
371#define MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, \
373 DECLARE_MYSQL_SYSVAR_SIMPLE(name, long) = { \
374 PLUGIN_VAR_LONG | ((opt)&PLUGIN_VAR_MASK), \
385#define MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, \
387 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \
388 PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
399#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, \
401 DECLARE_MYSQL_SYSVAR_SIMPLE(name, long long) = { \
402 PLUGIN_VAR_LONGLONG | ((opt)&PLUGIN_VAR_MASK), \
413#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, \
414 def, min, max, blk) \
415 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \
416 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
427#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, \
429 DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \
430 PLUGIN_VAR_ENUM | ((opt)&PLUGIN_VAR_MASK), \
439#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, \
441 DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \
442 PLUGIN_VAR_SET | ((opt)&PLUGIN_VAR_MASK), \
451#define MYSQL_SYSVAR_DOUBLE(name, varname, opt, comment, check, update, def, \
453 DECLARE_MYSQL_SYSVAR_SIMPLE(name, double) = { \
454 PLUGIN_VAR_DOUBLE | ((opt)&PLUGIN_VAR_MASK), \
465#define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \
466 DECLARE_MYSQL_THDVAR_BASIC(name, bool) = { \
467 PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
476#define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \
477 DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \
478 PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
487#define MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, \
489 DECLARE_MYSQL_THDVAR_SIMPLE(name, int) = { \
490 PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
502#define MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, \
504 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \
505 PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
506 ((opt)&PLUGIN_VAR_MASK), \
518#define MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, \
520 DECLARE_MYSQL_THDVAR_SIMPLE(name, long) = { \
521 PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
533#define MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, \
535 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \
536 PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
537 ((opt)&PLUGIN_VAR_MASK), \
549#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, \
551 DECLARE_MYSQL_THDVAR_SIMPLE(name, long long) = { \
552 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
564#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, \
566 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \
567 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
568 ((opt)&PLUGIN_VAR_MASK), \
580#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \
581 DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \
582 PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
592#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \
593 DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \
594 PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
604#define MYSQL_THDVAR_DOUBLE(name, opt, comment, check, update, def, min, max, \
606 DECLARE_MYSQL_THDVAR_SIMPLE(name, double) = { \
607 PLUGIN_VAR_DOUBLE | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
621#define SYSVAR(name) (*(MYSQL_SYSVAR_NAME(name).value))
624#define THDVAR(thd, name) \
625 (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset)))
627#define THDVAR_SET(thd, name, value) \
628 plugin_thdvar_safe_update(thd, MYSQL_SYSVAR(name), \
629 (char **)&THDVAR(thd, name), (const char *)value);
658#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0101
664#define MYSQL_REWRITE_PRE_PARSE_INTERFACE_VERSION 0x0010
665#define MYSQL_REWRITE_POST_PARSE_INTERFACE_VERSION 0x0010
672#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
688#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
704#define MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
721#define MYSQL_REPLICATION_INTERFACE_VERSION 0x0400
734#define thd_proc_info(thd, msg) \
735 set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
746 const char *calling_func,
747 const char *calling_file,
748 const unsigned int calling_line);
757 size_t max_query_len);
820 unsigned long long *pos_var);
865 const void *ha_data);
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:936
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
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:310
int thd_in_lock_tables(const MYSQL_THD thd)
Definition: sql_thd_api.cc:319
int thd_tx_is_read_only(const MYSQL_THD thd)
Definition: sql_thd_api.cc:407
unsigned long thd_get_thread_id(const MYSQL_THD thd)
Return the thread id of a user thread.
Definition: sql_thd_api.cc:572
int thd_allow_batch(MYSQL_THD thd)
Check if batching is allowed for the thread.
Definition: sql_thd_api.cc:583
#define MYSQL_THD
Definition: plugin.h:77
int thd_tx_is_dd_trx(const MYSQL_THD thd)
Definition: sql_thd_api.cc:432
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:479
int mysql_tmpfile(const char *prefix)
Create a temporary file.
Definition: sql_thd_api.cc:315
void thd_inc_row_count(MYSQL_THD thd)
Definition: sql_thd_api.cc:436
void remove_ssl_err_thread_state()
Interface to remove the per thread openssl error queue.
Definition: sql_thd_api.cc:706
int thd_sql_command(const MYSQL_THD thd)
Definition: sql_thd_api.cc:403
#define MYSQL_XIDDATASIZE
Definition: plugin.h:88
int thd_tx_priority(const MYSQL_THD thd)
Definition: sql_thd_api.cc:417
int thd_tx_isolation(const MYSQL_THD thd)
Definition: sql_thd_api.cc:405
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:352
int(* mysql_var_check_func)(MYSQL_THD thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
Definition: plugin.h:218
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:379
void * MYSQL_PLUGIN
Definition: plugin.h:82
int thd_tablespace_op(const MYSQL_THD thd)
Definition: sql_thd_api.cc:321
int thd_killed(const void *v_thd)
Check the killed state of a connection.
Definition: sql_thd_api.cc:557
unsigned int thd_get_num_vcpus()
Interface to get the number of VCPUs.
Definition: sql_thd_api.cc:712
void thd_storage_lock_wait(MYSQL_THD thd, long long value)
Definition: sql_thd_api.cc:372
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:387
void(* mysql_var_update_func)(MYSQL_THD thd, SYS_VAR *var, void *var_ptr, const void *save)
Definition: plugin.h:235
void thd_set_kill_status(const MYSQL_THD thd)
Set the killed status of the current statement.
Definition: sql_thd_api.cc:570
void ** thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton)
Definition: sql_thd_api.cc:368
void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid)
Get the XID for this connection's transaction.
Definition: sql_thd_api.cc:552
MYSQL_THD thd_tx_arbitrate(MYSQL_THD requestor, MYSQL_THD holder)
Definition: sql_thd_api.cc:421
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:590
long long thd_test_options(const MYSQL_THD thd, long long test_options)
Definition: sql_thd_api.cc:399
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:418
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:726
int interface_version
Definition: plugin.h:727
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:2734
int interface_version
Definition: plugin.h:680
unsigned int version
Definition: plugin.h:648
int type
Definition: plugin.h:636
SHOW_VAR * status_vars
Definition: plugin.h:649
int(* deinit)(MYSQL_PLUGIN)
Function to invoke when plugin is unloaded.
Definition: plugin.h:647
void * info
Definition: plugin.h:637
int(* check_uninstall)(MYSQL_PLUGIN)
Function to invoke when plugin is uninstalled.
Definition: plugin.h:645
unsigned long flags
Definition: plugin.h:652
int(* init)(MYSQL_PLUGIN)
Function to invoke when plugin is loaded.
Definition: plugin.h:643
const char * descr
Definition: plugin.h:640
const char * author
Definition: plugin.h:639
SYS_VAR ** system_vars
Definition: plugin.h:650
int license
Definition: plugin.h:641
void * __reserved1
Definition: plugin.h:651
const char * name
Definition: plugin.h:638
int interface_version
Definition: plugin.h:713
Definition: system_variables_bits.h:94
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:885