30#ifndef MYSQL_ABI_CHECK
49#if defined(MYSQL_DYNAMIC_PLUGIN)
51#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
53#define MYSQL_PLUGIN_EXPORT __declspec(dllexport)
57#define MYSQL_PLUGIN_EXPORT extern "C"
59#define MYSQL_PLUGIN_EXPORT
65#if defined(MYSQL_DYNAMIC_PLUGIN)
66#define MYSQL_PLUGIN_EXPORT MY_ATTRIBUTE((visibility("default")))
68#define MYSQL_PLUGIN_EXPORT
76#define MYSQL_THD THD *
78#define MYSQL_THD void *
83#ifndef MYSQL_ABI_CHECK
87#define MYSQL_XIDDATASIZE 128
107#define MYSQL_PLUGIN_INTERFACE_VERSION 0x010B
112#define MYSQL_UDF_PLUGIN 0
113#define MYSQL_STORAGE_ENGINE_PLUGIN 1
114#define MYSQL_FTPARSER_PLUGIN 2
115#define MYSQL_DAEMON_PLUGIN 3
116#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4
117#define MYSQL_AUDIT_PLUGIN 5
118#define MYSQL_REPLICATION_PLUGIN 6
119#define MYSQL_AUTHENTICATION_PLUGIN 7
120#define MYSQL_VALIDATE_PASSWORD_PLUGIN 8
121#define MYSQL_GROUP_REPLICATION_PLUGIN 9
122#define MYSQL_KEYRING_PLUGIN 10
123#define MYSQL_CLONE_PLUGIN 11
124#define MYSQL_MAX_PLUGIN_TYPE_NUM 12
127#define PLUGIN_LICENSE_PROPRIETARY 0
128#define PLUGIN_LICENSE_GPL 1
129#define PLUGIN_LICENSE_BSD 2
131#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY"
132#define PLUGIN_LICENSE_GPL_STRING "GPL"
133#define PLUGIN_LICENSE_BSD_STRING "BSD"
135#define PLUGIN_AUTHOR_ORACLE "Oracle Corporation"
143#ifndef MYSQL_DYNAMIC_PLUGIN
144#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
145 MYSQL_PLUGIN_EXPORT int VERSION = MYSQL_PLUGIN_INTERFACE_VERSION; \
146 MYSQL_PLUGIN_EXPORT int PSIZE = sizeof(struct st_mysql_plugin); \
147 MYSQL_PLUGIN_EXPORT struct st_mysql_plugin DECLS[] = {
149#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
150 MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_ = \
151 MYSQL_PLUGIN_INTERFACE_VERSION; \
152 MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_ = \
153 sizeof(struct st_mysql_plugin); \
154 MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[] = {
157#define mysql_declare_plugin(NAME) \
158 __MYSQL_DECLARE_PLUGIN(NAME, builtin_##NAME##_plugin_interface_version, \
159 builtin_##NAME##_sizeof_struct_st_plugin, \
160 builtin_##NAME##_plugin)
162#define mysql_declare_plugin_end \
163 , { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } \
170#define PLUGIN_OPT_NO_INSTALL 1UL
171#define PLUGIN_OPT_NO_UNINSTALL 2UL
172#define PLUGIN_OPT_ALLOW_EARLY 4UL
173#define PLUGIN_OPT_DEFAULT_OFF 8UL
185#define PLUGIN_OPT_DEPENDENT_EXTRA_PLUGINS 16UL
232 void *var_ptr,
const void *save);
236#define PLUGIN_VAR_MASK \
237 (PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT | \
238 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | \
239 PLUGIN_VAR_MEMALLOC | PLUGIN_VAR_NODEFAULT | PLUGIN_VAR_NOPERSIST | \
240 PLUGIN_VAR_PERSIST_AS_READ_ONLY | PLUGIN_VAR_INVISIBLE | \
241 PLUGIN_VAR_SENSITIVE)
243#define MYSQL_PLUGIN_VAR_HEADER \
246 const char *comment; \
247 mysql_var_check_func check; \
248 mysql_var_update_func update
250#define MYSQL_SYSVAR_NAME(name) mysql_sysvar_##name
251#define MYSQL_SYSVAR(name) ((SYS_VAR *)&(MYSQL_SYSVAR_NAME(name)))
260#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) \
262 MYSQL_PLUGIN_VAR_HEADER; \
264 const type def_val; \
265 } MYSQL_SYSVAR_NAME(name)
267#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) \
269 MYSQL_PLUGIN_VAR_HEADER; \
275 } MYSQL_SYSVAR_NAME(name)
277#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) \
279 MYSQL_PLUGIN_VAR_HEADER; \
283 } MYSQL_SYSVAR_NAME(name)
285#define DECLARE_THDVAR_FUNC(type) type *(*resolve)(MYSQL_THD thd, int offset)
287#define DECLARE_MYSQL_THDVAR_BASIC(name, type) \
289 MYSQL_PLUGIN_VAR_HEADER; \
291 const type def_val; \
292 DECLARE_THDVAR_FUNC(type); \
293 } MYSQL_SYSVAR_NAME(name)
295#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type) \
297 MYSQL_PLUGIN_VAR_HEADER; \
303 DECLARE_THDVAR_FUNC(type); \
304 } MYSQL_SYSVAR_NAME(name)
306#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) \
308 MYSQL_PLUGIN_VAR_HEADER; \
311 DECLARE_THDVAR_FUNC(type); \
313 } MYSQL_SYSVAR_NAME(name)
319#define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \
320 DECLARE_MYSQL_SYSVAR_BASIC(name, bool) = { \
321 PLUGIN_VAR_BOOL | ((opt)&PLUGIN_VAR_MASK), \
329#define MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) \
330 DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \
331 PLUGIN_VAR_STR | ((opt)&PLUGIN_VAR_MASK), \
339#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, \
341 DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \
342 PLUGIN_VAR_INT | ((opt)&PLUGIN_VAR_MASK), \
353#define MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, \
355 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \
356 PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
367#define MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, \
369 DECLARE_MYSQL_SYSVAR_SIMPLE(name, long) = { \
370 PLUGIN_VAR_LONG | ((opt)&PLUGIN_VAR_MASK), \
381#define MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, \
383 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \
384 PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
395#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, \
397 DECLARE_MYSQL_SYSVAR_SIMPLE(name, long long) = { \
398 PLUGIN_VAR_LONGLONG | ((opt)&PLUGIN_VAR_MASK), \
409#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, \
410 def, min, max, blk) \
411 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \
412 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
423#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, \
425 DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \
426 PLUGIN_VAR_ENUM | ((opt)&PLUGIN_VAR_MASK), \
435#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, \
437 DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \
438 PLUGIN_VAR_SET | ((opt)&PLUGIN_VAR_MASK), \
447#define MYSQL_SYSVAR_DOUBLE(name, varname, opt, comment, check, update, def, \
449 DECLARE_MYSQL_SYSVAR_SIMPLE(name, double) = { \
450 PLUGIN_VAR_DOUBLE | ((opt)&PLUGIN_VAR_MASK), \
461#define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \
462 DECLARE_MYSQL_THDVAR_BASIC(name, bool) = { \
463 PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
472#define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \
473 DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \
474 PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
483#define MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, \
485 DECLARE_MYSQL_THDVAR_SIMPLE(name, int) = { \
486 PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
498#define MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, \
500 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \
501 PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
502 ((opt)&PLUGIN_VAR_MASK), \
514#define MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, \
516 DECLARE_MYSQL_THDVAR_SIMPLE(name, long) = { \
517 PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
529#define MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, \
531 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \
532 PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
533 ((opt)&PLUGIN_VAR_MASK), \
545#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, \
547 DECLARE_MYSQL_THDVAR_SIMPLE(name, long long) = { \
548 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
560#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, \
562 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \
563 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
564 ((opt)&PLUGIN_VAR_MASK), \
576#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \
577 DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \
578 PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
588#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \
589 DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \
590 PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
600#define MYSQL_THDVAR_DOUBLE(name, opt, comment, check, update, def, min, max, \
602 DECLARE_MYSQL_THDVAR_SIMPLE(name, double) = { \
603 PLUGIN_VAR_DOUBLE | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
617#define SYSVAR(name) (*(MYSQL_SYSVAR_NAME(name).value))
620#define THDVAR(thd, name) \
621 (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset)))
623#define THDVAR_SET(thd, name, value) \
624 plugin_thdvar_safe_update(thd, MYSQL_SYSVAR(name), \
625 (char **)&THDVAR(thd, name), (const char *)value);
654#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0101
660#define MYSQL_REWRITE_PRE_PARSE_INTERFACE_VERSION 0x0010
661#define MYSQL_REWRITE_POST_PARSE_INTERFACE_VERSION 0x0010
668#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
684#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
700#define MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
717#define MYSQL_REPLICATION_INTERFACE_VERSION 0x0400
730#define thd_proc_info(thd, msg) \
731 set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
742 const char *calling_func,
743 const char *calling_file,
744 const unsigned int calling_line);
753 size_t max_query_len);
816 unsigned long long *pos_var);
861 const void *ha_data);
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:850
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
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:308
int thd_in_lock_tables(const MYSQL_THD thd)
Definition: sql_thd_api.cc:317
int thd_tx_is_read_only(const MYSQL_THD thd)
Definition: sql_thd_api.cc:405
unsigned long thd_get_thread_id(const MYSQL_THD thd)
Return the thread id of a user thread.
Definition: sql_thd_api.cc:562
int thd_allow_batch(MYSQL_THD thd)
Check if batching is allowed for the thread.
Definition: sql_thd_api.cc:573
#define MYSQL_THD
Definition: plugin.h:76
int thd_tx_is_dd_trx(const MYSQL_THD thd)
Definition: sql_thd_api.cc:422
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:469
int mysql_tmpfile(const char *prefix)
Create a temporary file.
Definition: sql_thd_api.cc:313
void thd_inc_row_count(MYSQL_THD thd)
Definition: sql_thd_api.cc:426
void remove_ssl_err_thread_state()
Interface to remove the per thread openssl error queue.
Definition: sql_thd_api.cc:696
int thd_sql_command(const MYSQL_THD thd)
Definition: sql_thd_api.cc:401
#define MYSQL_XIDDATASIZE
Definition: plugin.h:87
int thd_tx_priority(const MYSQL_THD thd)
Definition: sql_thd_api.cc:407
int thd_tx_isolation(const MYSQL_THD thd)
Definition: sql_thd_api.cc:403
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:350
int(* mysql_var_check_func)(MYSQL_THD thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
Definition: plugin.h:214
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:377
void * MYSQL_PLUGIN
Definition: plugin.h:81
int thd_tablespace_op(const MYSQL_THD thd)
Definition: sql_thd_api.cc:319
int thd_killed(const void *v_thd)
Check the killed state of a connection.
Definition: sql_thd_api.cc:547
unsigned int thd_get_num_vcpus()
Interface to get the number of VCPUs.
Definition: sql_thd_api.cc:702
void thd_storage_lock_wait(MYSQL_THD thd, long long value)
Definition: sql_thd_api.cc:370
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:385
void(* mysql_var_update_func)(MYSQL_THD thd, SYS_VAR *var, void *var_ptr, const void *save)
Definition: plugin.h:231
void thd_set_kill_status(const MYSQL_THD thd)
Set the killed status of the current statement.
Definition: sql_thd_api.cc:560
void ** thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton)
Definition: sql_thd_api.cc:366
void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid)
Get the XID for this connection's transaction.
Definition: sql_thd_api.cc:542
MYSQL_THD thd_tx_arbitrate(MYSQL_THD requestor, MYSQL_THD holder)
Definition: sql_thd_api.cc:411
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:580
long long thd_test_options(const MYSQL_THD thd, long long test_options)
Definition: sql_thd_api.cc:397
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:75
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:419
MYSQL_XID is binary compatible with the XID structure as in the X/Open CAE Specification,...
Definition: plugin.h:96
long bqual_length
Definition: plugin.h:99
char data[MYSQL_XIDDATASIZE]
Definition: plugin.h:100
long formatID
Definition: plugin.h:97
long gtrid_length
Definition: plugin.h:98
Replication plugin descriptor.
Definition: plugin.h:722
int interface_version
Definition: plugin.h:723
SHOW STATUS Server status variable.
Definition: status_var.h:78
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2594
int interface_version
Definition: plugin.h:676
unsigned int version
Definition: plugin.h:644
int type
Definition: plugin.h:632
SHOW_VAR * status_vars
Definition: plugin.h:645
int(* deinit)(MYSQL_PLUGIN)
Function to invoke when plugin is unloaded.
Definition: plugin.h:643
void * info
Definition: plugin.h:633
int(* check_uninstall)(MYSQL_PLUGIN)
Function to invoke when plugin is uninstalled.
Definition: plugin.h:641
unsigned long flags
Definition: plugin.h:648
int(* init)(MYSQL_PLUGIN)
Function to invoke when plugin is loaded.
Definition: plugin.h:639
const char * descr
Definition: plugin.h:636
const char * author
Definition: plugin.h:635
SYS_VAR ** system_vars
Definition: plugin.h:646
int license
Definition: plugin.h:637
void * __reserved1
Definition: plugin.h:647
const char * name
Definition: plugin.h:634
int interface_version
Definition: plugin.h:709
Definition: system_variables_bits.h:93
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:868