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 0x010A
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
220 void *var_ptr,
const void *save);
224#define PLUGIN_VAR_MASK \
225 (PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT | \
226 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | \
227 PLUGIN_VAR_MEMALLOC | PLUGIN_VAR_NODEFAULT | PLUGIN_VAR_NOPERSIST | \
228 PLUGIN_VAR_PERSIST_AS_READ_ONLY | PLUGIN_VAR_INVISIBLE | \
229 PLUGIN_VAR_SENSITIVE)
231#define MYSQL_PLUGIN_VAR_HEADER \
234 const char *comment; \
235 mysql_var_check_func check; \
236 mysql_var_update_func update
238#define MYSQL_SYSVAR_NAME(name) mysql_sysvar_##name
239#define MYSQL_SYSVAR(name) ((SYS_VAR *)&(MYSQL_SYSVAR_NAME(name)))
248#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) \
250 MYSQL_PLUGIN_VAR_HEADER; \
252 const type def_val; \
253 } MYSQL_SYSVAR_NAME(name)
255#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) \
257 MYSQL_PLUGIN_VAR_HEADER; \
263 } MYSQL_SYSVAR_NAME(name)
265#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) \
267 MYSQL_PLUGIN_VAR_HEADER; \
271 } MYSQL_SYSVAR_NAME(name)
273#define DECLARE_THDVAR_FUNC(type) type *(*resolve)(MYSQL_THD thd, int offset)
275#define DECLARE_MYSQL_THDVAR_BASIC(name, type) \
277 MYSQL_PLUGIN_VAR_HEADER; \
279 const type def_val; \
280 DECLARE_THDVAR_FUNC(type); \
281 } MYSQL_SYSVAR_NAME(name)
283#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type) \
285 MYSQL_PLUGIN_VAR_HEADER; \
291 DECLARE_THDVAR_FUNC(type); \
292 } MYSQL_SYSVAR_NAME(name)
294#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) \
296 MYSQL_PLUGIN_VAR_HEADER; \
299 DECLARE_THDVAR_FUNC(type); \
301 } MYSQL_SYSVAR_NAME(name)
307#define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \
308 DECLARE_MYSQL_SYSVAR_BASIC(name, bool) = { \
309 PLUGIN_VAR_BOOL | ((opt)&PLUGIN_VAR_MASK), \
317#define MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) \
318 DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \
319 PLUGIN_VAR_STR | ((opt)&PLUGIN_VAR_MASK), \
327#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, \
329 DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \
330 PLUGIN_VAR_INT | ((opt)&PLUGIN_VAR_MASK), \
341#define MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, \
343 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \
344 PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
355#define MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, \
357 DECLARE_MYSQL_SYSVAR_SIMPLE(name, long) = { \
358 PLUGIN_VAR_LONG | ((opt)&PLUGIN_VAR_MASK), \
369#define MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, \
371 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \
372 PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
383#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, \
385 DECLARE_MYSQL_SYSVAR_SIMPLE(name, long long) = { \
386 PLUGIN_VAR_LONGLONG | ((opt)&PLUGIN_VAR_MASK), \
397#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, \
398 def, min, max, blk) \
399 DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \
400 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt)&PLUGIN_VAR_MASK), \
411#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, \
413 DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \
414 PLUGIN_VAR_ENUM | ((opt)&PLUGIN_VAR_MASK), \
423#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, \
425 DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \
426 PLUGIN_VAR_SET | ((opt)&PLUGIN_VAR_MASK), \
435#define MYSQL_SYSVAR_DOUBLE(name, varname, opt, comment, check, update, def, \
437 DECLARE_MYSQL_SYSVAR_SIMPLE(name, double) = { \
438 PLUGIN_VAR_DOUBLE | ((opt)&PLUGIN_VAR_MASK), \
449#define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \
450 DECLARE_MYSQL_THDVAR_BASIC(name, bool) = { \
451 PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
460#define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \
461 DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \
462 PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
471#define MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, \
473 DECLARE_MYSQL_THDVAR_SIMPLE(name, int) = { \
474 PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
486#define MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, \
488 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \
489 PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
490 ((opt)&PLUGIN_VAR_MASK), \
502#define MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, \
504 DECLARE_MYSQL_THDVAR_SIMPLE(name, long) = { \
505 PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
517#define MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, \
519 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \
520 PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
521 ((opt)&PLUGIN_VAR_MASK), \
533#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, \
535 DECLARE_MYSQL_THDVAR_SIMPLE(name, long long) = { \
536 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
548#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, \
550 DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \
551 PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | \
552 ((opt)&PLUGIN_VAR_MASK), \
564#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \
565 DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \
566 PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
576#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \
577 DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \
578 PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
588#define MYSQL_THDVAR_DOUBLE(name, opt, comment, check, update, def, min, max, \
590 DECLARE_MYSQL_THDVAR_SIMPLE(name, double) = { \
591 PLUGIN_VAR_DOUBLE | PLUGIN_VAR_THDLOCAL | ((opt)&PLUGIN_VAR_MASK), \
605#define SYSVAR(name) (*(MYSQL_SYSVAR_NAME(name).value))
608#define THDVAR(thd, name) \
609 (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset)))
611#define THDVAR_SET(thd, name, value) \
612 plugin_thdvar_safe_update(thd, MYSQL_SYSVAR(name), \
613 (char **)&THDVAR(thd, name), (const char *)value);
642#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0101
648#define MYSQL_REWRITE_PRE_PARSE_INTERFACE_VERSION 0x0010
649#define MYSQL_REWRITE_POST_PARSE_INTERFACE_VERSION 0x0010
656#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
672#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
688#define MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
705#define MYSQL_REPLICATION_INTERFACE_VERSION 0x0400
724#define MYSQL_VALUE_TYPE_STRING 0
725#define MYSQL_VALUE_TYPE_REAL 1
726#define MYSQL_VALUE_TYPE_INT 2
740#define thd_proc_info(thd, msg) \
741 set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
752 const char *calling_func,
753 const char *calling_file,
754 const unsigned int calling_line);
763 size_t max_query_len);
826 unsigned long long *pos_var);
871 const void *ha_data);
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:802
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:945
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:296
int thd_in_lock_tables(const MYSQL_THD thd)
Definition: sql_thd_api.cc:305
int thd_tx_is_read_only(const MYSQL_THD thd)
Definition: sql_thd_api.cc:393
unsigned long thd_get_thread_id(const MYSQL_THD thd)
Return the thread id of a user thread.
Definition: sql_thd_api.cc:520
int thd_allow_batch(MYSQL_THD thd)
Check if batching is allowed for the thread.
Definition: sql_thd_api.cc:531
#define MYSQL_THD
Definition: plugin.h:76
int thd_tx_is_dd_trx(const MYSQL_THD thd)
Definition: sql_thd_api.cc:410
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:430
int mysql_tmpfile(const char *prefix)
Create a temporary file.
Definition: sql_thd_api.cc:301
void thd_inc_row_count(MYSQL_THD thd)
Definition: sql_thd_api.cc:414
void remove_ssl_err_thread_state()
Interface to remove the per thread openssl error queue.
Definition: sql_thd_api.cc:650
int thd_sql_command(const MYSQL_THD thd)
Definition: sql_thd_api.cc:389
#define MYSQL_XIDDATASIZE
Definition: plugin.h:87
int thd_tx_priority(const MYSQL_THD thd)
Definition: sql_thd_api.cc:395
int thd_tx_isolation(const MYSQL_THD thd)
Definition: sql_thd_api.cc:391
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:338
int(* mysql_var_check_func)(MYSQL_THD thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
Definition: plugin.h:202
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:365
void * MYSQL_PLUGIN
Definition: plugin.h:81
int thd_tablespace_op(const MYSQL_THD thd)
Definition: sql_thd_api.cc:307
int thd_killed(const void *v_thd)
Check the killed state of a connection.
Definition: sql_thd_api.cc:505
unsigned int thd_get_num_vcpus()
Interface to get the number of VCPUs.
Definition: sql_thd_api.cc:656
void thd_storage_lock_wait(MYSQL_THD thd, long long value)
Definition: sql_thd_api.cc:358
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:373
void(* mysql_var_update_func)(MYSQL_THD thd, SYS_VAR *var, void *var_ptr, const void *save)
Definition: plugin.h:219
void thd_set_kill_status(const MYSQL_THD thd)
Set the killed status of the current statement.
Definition: sql_thd_api.cc:518
void ** thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton)
Definition: sql_thd_api.cc:354
void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid)
Get the XID for this connection's transaction.
Definition: sql_thd_api.cc:500
MYSQL_THD thd_tx_arbitrate(MYSQL_THD requestor, MYSQL_THD holder)
Definition: sql_thd_api.cc:399
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:538
long long thd_test_options(const MYSQL_THD thd, long long test_options)
Definition: sql_thd_api.cc:385
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:391
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:710
int interface_version
Definition: plugin.h:711
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:2416
int interface_version
Definition: plugin.h:664
unsigned int version
Definition: plugin.h:632
int type
Definition: plugin.h:620
SHOW_VAR * status_vars
Definition: plugin.h:633
int(* deinit)(MYSQL_PLUGIN)
Function to invoke when plugin is unloaded.
Definition: plugin.h:631
void * info
Definition: plugin.h:621
int(* check_uninstall)(MYSQL_PLUGIN)
Function to invoke when plugin is uninstalled.
Definition: plugin.h:629
unsigned long flags
Definition: plugin.h:636
int(* init)(MYSQL_PLUGIN)
Function to invoke when plugin is loaded.
Definition: plugin.h:627
const char * descr
Definition: plugin.h:624
const char * author
Definition: plugin.h:623
SYS_VAR ** system_vars
Definition: plugin.h:634
int license
Definition: plugin.h:625
void * __reserved1
Definition: plugin.h:635
const char * name
Definition: plugin.h:622
int interface_version
Definition: plugin.h:697
int(* val_int)(struct st_mysql_value *, long long *intbuf)
Definition: plugin.h:732
int(* val_real)(struct st_mysql_value *, double *realbuf)
Definition: plugin.h:731
int(* is_unsigned)(struct st_mysql_value *)
Definition: plugin.h:733
int(* value_type)(struct st_mysql_value *)
Definition: plugin.h:729
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:868