MySQL 9.0.0
Source Code Documentation
sql_plugin_var.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef _sql_comp_common_h
25#define _sql_comp_common_h
26
27#include <string.h>
28#include <sys/types.h>
29#include <new>
30#include <string>
31
32#include "lex_string.h"
33#include "map_helpers.h"
34#include "memory_debugging.h"
35#include "my_compiler.h"
36#include "my_getopt.h"
37#include "my_inttypes.h"
38#include "my_sys.h"
40#include "mysql/plugin.h"
43#include "sql/set_var.h"
44
45class Item;
46class THD;
47struct MEM_ROOT;
48struct SYS_VAR;
49struct TYPELIB;
50struct st_plugin_int;
51
52/*
53 Below define's are used for internal purpose(i.e used by plugin and
54 component infrastuctures, These are not supposed to be used in other files.
55*/
56#define OPTION_SET_LIMITS(type, options, opt) \
57 options->var_type = type; \
58 options->def_value = (opt)->def_val; \
59 options->min_value = (opt)->min_val; \
60 options->max_value = (opt)->max_val; \
61 options->block_size = (long)(opt)->blk_sz
62
63#define OPTION_SET_LIMITS_DOUBLE(options, opt) \
64 options->var_type = GET_DOUBLE; \
65 options->def_value = (longlong)getopt_double2ulonglong((opt)->def_val); \
66 options->min_value = (longlong)getopt_double2ulonglong((opt)->min_val); \
67 options->max_value = getopt_double2ulonglong((opt)->max_val); \
68 options->block_size = (long)(opt)->blk_sz;
69
70/****************************************************************************
71 Internal type declarations for variables support
72****************************************************************************/
73
74#undef MYSQL_SYSVAR_NAME
75#define MYSQL_SYSVAR_NAME(name) name
76#define PLUGIN_VAR_TYPEMASK 0x007f
77#define PLUGIN_VAR_WITH_SIGN_TYPEMASK 0x00ff
78
79#define EXTRA_OPTIONS 3 /* options for: 'foo', 'plugin-foo' and NULL */
80
81/*
82 Below typedef's are used for internal purpose(i.e used by plugin and
83 component infrastuctures, These are not supposed to be used in other files.
84*/
85typedef DECLARE_MYSQL_SYSVAR_BASIC(sysvar_bool_t, bool);
86typedef DECLARE_MYSQL_THDVAR_BASIC(thdvar_bool_t, bool);
87typedef DECLARE_MYSQL_SYSVAR_BASIC(sysvar_str_t, char *);
88typedef DECLARE_MYSQL_THDVAR_BASIC(thdvar_str_t, char *);
89
90typedef DECLARE_MYSQL_SYSVAR_TYPELIB(sysvar_enum_t, unsigned long);
91typedef DECLARE_MYSQL_THDVAR_TYPELIB(thdvar_enum_t, unsigned long);
94
95typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_int_t, int);
96typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_long_t, long);
97typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_longlong_t, longlong);
98typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_uint_t, uint);
99typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_ulong_t, ulong);
100typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_ulonglong_t, ulonglong);
101typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_double_t, double);
102
103typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_int_t, int);
104typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_long_t, long);
105typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_longlong_t, longlong);
106typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_uint_t, uint);
107typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_ulong_t, ulong);
108typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_ulonglong_t, ulonglong);
109typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_double_t, double);
110
111/****************************************************************************
112 default variable data check and update functions
113****************************************************************************/
114int check_func_bool(THD *, SYS_VAR *, void *save, st_mysql_value *value);
115
116int check_func_int(THD *thd, SYS_VAR *var, void *save, st_mysql_value *value);
117
118int check_func_long(THD *thd, SYS_VAR *var, void *save, st_mysql_value *value);
119
120int check_func_longlong(THD *thd, SYS_VAR *var, void *save,
121 st_mysql_value *value);
122
123int check_func_str(THD *thd, SYS_VAR *, void *save, st_mysql_value *value);
124
125int check_func_enum(THD *, SYS_VAR *var, void *save, st_mysql_value *value);
126
127int check_func_set(THD *, SYS_VAR *var, void *save, st_mysql_value *value);
128
129int check_func_double(THD *thd, SYS_VAR *var, void *save,
130 st_mysql_value *value);
131
132void update_func_bool(THD *, SYS_VAR *, void *tgt, const void *save);
133
134void update_func_int(THD *, SYS_VAR *, void *tgt, const void *save);
135
136void update_func_long(THD *, SYS_VAR *, void *tgt, const void *save);
137
138void update_func_longlong(THD *, SYS_VAR *, void *tgt, const void *save);
139
140void update_func_str(THD *, SYS_VAR *, void *tgt, const void *save);
141
142void update_func_double(THD *, SYS_VAR *, void *tgt, const void *save);
143
145const void *pluginvar_default_value(SYS_VAR *plugin_var);
146
148const char *item_val_str(st_mysql_value *value, char *buffer, int *length);
149int item_val_int(st_mysql_value *value, long long *buf);
151int item_val_real(st_mysql_value *value, double *buf);
152
153void plugin_opt_set_limits(struct my_option *, const SYS_VAR *);
154
155uchar *intern_sys_var_ptr(THD *thd, int offset, bool global_lock);
156
157bool plugin_var_memalloc_global_update(THD *thd, SYS_VAR *var, char **dest,
158 const char *value);
159bool plugin_var_memalloc_session_update(THD *thd, SYS_VAR *var, char **dest,
160 const char *value);
161
162/*
163 stored in bookmark_hash, this structure is never removed from the
164 hash and is used to mark a single offset for a thd local variable
165 even if plugins have been uninstalled and reinstalled, repeatedly.
166 This structure is allocated from plugin_mem_root.
167
168 The key format is as follows:
169 1 byte - variable type code
170 name_len bytes - variable name
171 '\0' - end of key
172*/
174 size_t name_len;
177 char key[1];
178};
179
180st_bookmark *find_bookmark(const char *plugin, const char *name, int flags);
181
185/** Hash for system variables of string type with MEMALLOC flag. */
188
189/*
190 returns a bookmark for thd-local variables, creating if necessary.
191 returns null for non thd-local variables.
192 Requires that a write lock is obtained on LOCK_system_variables_hash
193*/
194st_bookmark *register_var(const char *plugin, const char *name, int flags);
195
196bool *mysql_sys_var_bool(THD *thd, int offset);
197int *mysql_sys_var_int(THD *thd, int offset);
198unsigned int *mysql_sys_var_uint(THD *thd, int offset);
199unsigned long *mysql_sys_var_ulong(THD *thd, int offset);
200unsigned long long *mysql_sys_var_ulonglong(THD *thd, int offset);
201char **mysql_sys_var_str(THD *thd, int offset);
202double *mysql_sys_var_double(THD *thd, int offset);
203
204/*
205 skeleton of a plugin variable - portion of structure common to all.
206*/
207struct SYS_VAR {
209};
210
211inline void convert_underscore_to_dash(char *str, size_t len) {
212 for (char *p = str; p <= str + len; p++)
213 if (*p == '_') *p = '-';
214}
215
216/*
217 sys_var class for access to all plugin variables visible to the user
218*/
220 static bool on_check_pluginvar(sys_var *self, THD *, set_var *var);
221
222 public:
226 /**
227 variable name from whatever is hard-coded in the plugin source
228 and doesn't have pluginname- prefix is replaced by an allocated name
229 with a plugin prefix. When plugin is uninstalled we need to restore the
230 pointer to point to the hard-coded value, because plugin may be
231 installed/uninstalled many times without reloading the shared object.
232 */
234
235 static void *operator new(size_t size, MEM_ROOT *mem_root,
236 const std::nothrow_t &arg
237 [[maybe_unused]] = std::nothrow) noexcept {
238 return mem_root->Alloc(size);
239 }
240
241 static void *operator new(size_t size) {
243 }
244
245 static void operator delete(void *ptr_arg [[maybe_unused]],
246 size_t size [[maybe_unused]]) {
247 TRASH(ptr_arg, size);
248 }
249
250 static void operator delete(
251 void *, MEM_ROOT *, const std::nothrow_t &) noexcept { /* never called */
252 }
253
254 static void operator delete(void *ptr) { my_free(ptr); }
255
256 sys_var_pluginvar(sys_var_chain *chain, const char *name_arg,
257 SYS_VAR *plugin_var_arg)
258 : sys_var(
259 chain, name_arg, plugin_var_arg->comment,
260 (plugin_var_arg->flags & PLUGIN_VAR_THDLOCAL ? SESSION : GLOBAL) |
261 (plugin_var_arg->flags & PLUGIN_VAR_READONLY ? READONLY : 0) |
262 (plugin_var_arg->flags & PLUGIN_VAR_INVISIBLE ? INVISIBLE : 0) |
263 (plugin_var_arg->flags & PLUGIN_VAR_PERSIST_AS_READ_ONLY
265 : 0) |
266 (plugin_var_arg->flags & PLUGIN_VAR_SENSITIVE ? SENSITIVE : 0),
267 0, (plugin_var_arg->flags & PLUGIN_VAR_NOCMDOPT) ? -1 : 0,
268 (plugin_var_arg->flags & PLUGIN_VAR_NOCMDARG
269 ? NO_ARG
270 : (plugin_var_arg->flags & PLUGIN_VAR_OPCMDARG
271 ? OPT_ARG
272 : (plugin_var_arg->flags & PLUGIN_VAR_RQCMDARG
274 : REQUIRED_ARG))),
275 pluginvar_show_type(plugin_var_arg),
276 (intptr)pluginvar_default_value(plugin_var_arg), nullptr,
278 (plugin_var_arg->flags & PLUGIN_VAR_NODEFAULT) ? on_check_pluginvar
279 : nullptr,
281 plugin_var(plugin_var_arg),
282 orig_pluginvar_name(plugin_var_arg->name) {
283 plugin_var->name = name_arg;
284 is_plugin = true;
285 }
286 sys_var_pluginvar *cast_pluginvar() override { return this; }
287 bool check_update_type(Item_result type) override;
291 uchar *do_value_ptr(THD *running_thd, THD *target_thd, enum_var_type type,
292 std::string_view keycache_name);
294 std::string_view keycache_name) {
295 return do_value_ptr(thd, thd, type, keycache_name);
296 }
297 const uchar *session_value_ptr(THD *running_thd, THD *target_thd,
298 std::string_view keycache_name) override {
299 return do_value_ptr(running_thd, target_thd, OPT_SESSION, keycache_name);
300 }
302 std::string_view keycache_name) override {
303 return do_value_ptr(thd, OPT_GLOBAL, keycache_name);
304 }
305 bool do_check(THD *thd, set_var *var) override;
306 void session_save_default(THD *, set_var *) override {}
307 void saved_value_to_string(THD *thd, set_var *var, char *def_val) override;
308 void global_save_default(THD *, set_var *) override {}
309 bool session_update(THD *thd, set_var *var) override;
310 bool global_update(THD *thd, set_var *var) override;
311 longlong get_min_value() override;
312 ulonglong get_max_value() override;
313 void set_arg_source(get_opt_arg_source *src) override {
314 strcpy(source.m_path_name, src->m_path_name);
315 source.m_source = src->m_source;
316 }
317 bool is_non_persistent() override {
318 return (plugin_var->flags & PLUGIN_VAR_NOPERSIST);
319 }
320 void set_is_plugin(bool val) override { is_plugin = val; }
321};
322
323/*
324 hidden part of opaque value passed to variable check functions.
325 Used to provide a object-like structure to non C++ consumers.
326*/
329};
330
331// Defined in sql_plugin.cc, but declared here since sql_plugin.h has so
332// many users and would like not to include "map_helpers.h".
334
335#endif
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:930
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
std::unordered_map, but with my_malloc, so that you can track the memory used using PSI memory keys.
Definition: map_helpers.h:157
set_var_base descendant for assignments to the system variables.
Definition: set_var.h:983
Definition: sql_plugin_var.h:219
TYPELIB * plugin_var_typelib(void)
Definition: sql_plugin_var.cc:333
SYS_VAR * plugin_var
Definition: sql_plugin_var.h:225
uchar * do_value_ptr(THD *thd, enum_var_type type, std::string_view keycache_name)
Definition: sql_plugin_var.h:293
bool is_plugin
Definition: sql_plugin_var.h:223
void set_arg_source(get_opt_arg_source *src) override
Definition: sql_plugin_var.h:313
void global_save_default(THD *, set_var *) override
save the global default value of the variable in var
Definition: sql_plugin_var.h:308
void session_save_default(THD *, set_var *) override
save the session default value of the variable in var
Definition: sql_plugin_var.h:306
bool is_non_persistent() override
Definition: sql_plugin_var.h:317
sys_var_pluginvar(sys_var_chain *chain, const char *name_arg, SYS_VAR *plugin_var_arg)
Definition: sql_plugin_var.h:256
st_plugin_int * plugin
Definition: sql_plugin_var.h:224
bool session_update(THD *thd, set_var *var) override
Definition: sql_plugin_var.cc:378
ulonglong get_max_value() override
Definition: sql_plugin_var.cc:446
const uchar * session_value_ptr(THD *running_thd, THD *target_thd, std::string_view keycache_name) override
A pointer to a value of the variable for SHOW.
Definition: sql_plugin_var.h:297
bool check_update_type(Item_result type) override
Definition: sql_plugin_var.cc:302
void set_is_plugin(bool val) override
Definition: sql_plugin_var.h:320
uchar * do_value_ptr(THD *running_thd, THD *target_thd, enum_var_type type, std::string_view keycache_name)
Definition: sql_plugin_var.cc:349
const uchar * global_value_ptr(THD *thd, std::string_view keycache_name) override
Definition: sql_plugin_var.h:301
const char * orig_pluginvar_name
variable name from whatever is hard-coded in the plugin source and doesn't have pluginname- prefix is...
Definition: sql_plugin_var.h:233
void saved_value_to_string(THD *thd, set_var *var, char *def_val) override
This function converts value stored in save_result to string.
Definition: sql_plugin_var.cc:500
uchar * real_value_ptr(THD *thd, enum_var_type type)
Definition: sql_plugin_var.cc:322
sys_var_pluginvar * cast_pluginvar() override
downcast for sys_var_pluginvar.
Definition: sql_plugin_var.h:286
longlong get_min_value() override
Definition: sql_plugin_var.cc:424
static bool on_check_pluginvar(sys_var *self, THD *, set_var *var)
Enforce the NO DEFAULT policy for plugin system variables.
Definition: sql_plugin_var.cc:492
bool do_check(THD *thd, set_var *var) override
Definition: sql_plugin_var.cc:364
SHOW_TYPE show_type()
bool global_update(THD *thd, set_var *var) override
Definition: sql_plugin_var.cc:401
A class representing one system variable - that is something that can be accessed as @global....
Definition: set_var.h:107
LEX_CSTRING name
Definition: set_var.h:110
@ SESSION
Definition: set_var.h:130
@ GLOBAL
Definition: set_var.h:129
@ INVISIBLE
Definition: set_var.h:135
@ SENSITIVE
Sensitive variable.
Definition: set_var.h:153
@ READONLY
Definition: set_var.h:133
@ PERSIST_AS_READ_ONLY
There can be some variables which needs to be set before plugin is loaded.
Definition: set_var.h:148
@ VARIABLE_NOT_IN_BINLOG
Definition: set_var.h:162
struct get_opt_arg_source source
Definition: set_var.h:190
int flags
or'ed flag_enum values
Definition: set_var.h:175
static const int PARSE_NORMAL
Definition: set_var.h:156
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
const char * p
Definition: ctype-mb.cc:1225
#define PLUGIN_VAR_OPCMDARG
Argument optional for cmd line.
Definition: system_variables_bits.h:70
#define PLUGIN_VAR_NOPERSIST
SET PERSIST_ONLY is prohibited for read only variables.
Definition: system_variables_bits.h:73
#define PLUGIN_VAR_THDLOCAL
Variable is per-connection.
Definition: system_variables_bits.h:64
#define PLUGIN_VAR_RQCMDARG
Argument required for cmd line.
Definition: system_variables_bits.h:69
#define PLUGIN_VAR_READONLY
Server variable is read only.
Definition: system_variables_bits.h:65
#define PLUGIN_VAR_NOCMDOPT
Not a command line option.
Definition: system_variables_bits.h:67
#define PLUGIN_VAR_SENSITIVE
Sensitive variable.
Definition: system_variables_bits.h:77
#define PLUGIN_VAR_NOCMDARG
No argument for cmd line.
Definition: system_variables_bits.h:68
#define PLUGIN_VAR_PERSIST_AS_READ_ONLY
Definition: system_variables_bits.h:75
#define PLUGIN_VAR_INVISIBLE
Variable should not be shown.
Definition: system_variables_bits.h:76
#define PLUGIN_VAR_NODEFAULT
SET DEFAULT is prohibited.
Definition: system_variables_bits.h:71
static int flags[50]
Definition: hp_test1.cc:40
#define comment
Definition: lexyy.cc:959
Various macros useful for communicating with memory debuggers, such as Valgrind.
void TRASH(void *ptr, size_t length)
Put bad content in memory to be sure it will segfault if dereferenced.
Definition: memory_debugging.h:71
Header for compiler-dependent features.
@ OPT_ARG
Definition: my_getopt.h:81
@ REQUIRED_ARG
Definition: my_getopt.h:81
@ NO_ARG
Definition: my_getopt.h:81
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52
intptr_t intptr
Definition: my_inttypes.h:70
long long int longlong
Definition: my_inttypes.h:55
#define MYF(v)
Definition: my_inttypes.h:97
void * my_malloc(PSI_memory_key key, size_t size, int flags)
Allocates size bytes of memory.
Definition: my_memory.cc:57
void my_free(void *ptr)
Frees the memory pointed by the ptr.
Definition: my_memory.cc:81
Common header for many mysys elements.
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
Definition: buf0block_hint.cc:30
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
size_t size(const char *const c)
Definition: base64.h:46
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
Performance schema instrumentation interface.
required string type
Definition: replication_group_member_actions.proto:34
"public" interface to sys_var - server configuration variables.
enum enum_mysql_show_type SHOW_TYPE
Definition: set_var.h:75
enum_var_type
Definition: set_var.h:92
@ OPT_GLOBAL
Definition: set_var.h:95
@ OPT_SESSION
Definition: set_var.h:94
int check_func_str(THD *thd, SYS_VAR *, void *save, st_mysql_value *value)
Definition: sql_plugin_var.cc:672
uint global_variables_dynamic_size
Definition: sql_plugin.cc:465
typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_int_t, int)
typedef DECLARE_MYSQL_SYSVAR_BASIC(sysvar_bool_t, bool)
const char * item_val_str(st_mysql_value *value, char *buffer, int *length)
Definition: sql_plugin_var.cc:269
double * mysql_sys_var_double(THD *thd, int offset)
Definition: sql_plugin_var.cc:1077
MEM_ROOT plugin_mem_root
Definition: sql_plugin.cc:464
malloc_unordered_map< std::string, st_bookmark * > * get_bookmark_hash()
Definition: sql_plugin.cc:503
bool plugin_var_memalloc_session_update(THD *thd, SYS_VAR *var, char **dest, const char *value)
Set value for thread local variable with PLUGIN_VAR_MEMALLOC flag.
Definition: sql_plugin_var.cc:123
int check_func_bool(THD *, SYS_VAR *, void *save, st_mysql_value *value)
Definition: sql_plugin_var.cc:586
void update_func_long(THD *, SYS_VAR *, void *tgt, const void *save)
Definition: sql_plugin_var.cc:767
malloc_unordered_map< std::string, st_bookmark * > * bookmark_hash
Definition: sql_plugin.cc:466
int * mysql_sys_var_int(THD *thd, int offset)
Definition: sql_plugin_var.cc:1057
void update_func_bool(THD *, SYS_VAR *, void *tgt, const void *save)
Definition: sql_plugin_var.cc:759
st_bookmark * find_bookmark(const char *plugin, const char *name, int flags)
Definition: sql_plugin_var.cc:788
int check_func_enum(THD *, SYS_VAR *var, void *save, st_mysql_value *value)
Definition: sql_plugin_var.cc:684
typedef DECLARE_MYSQL_THDVAR_BASIC(thdvar_bool_t, bool)
void update_func_double(THD *, SYS_VAR *, void *tgt, const void *save)
Definition: sql_plugin_var.cc:779
int check_func_long(THD *thd, SYS_VAR *var, void *save, st_mysql_value *value)
Definition: sql_plugin_var.cc:629
typedef DECLARE_MYSQL_THDVAR_TYPELIB(thdvar_enum_t, unsigned long)
SHOW_TYPE pluginvar_show_type(SYS_VAR *plugin_var)
Definition: sql_plugin_var.cc:158
void update_func_longlong(THD *, SYS_VAR *, void *tgt, const void *save)
Definition: sql_plugin_var.cc:771
const void * pluginvar_default_value(SYS_VAR *plugin_var)
Definition: sql_plugin_var.cc:187
malloc_unordered_map< std::string, st_bookmark * > * malloced_string_type_sysvars_bookmark_hash
Hash for system variables of string type with MEMALLOC flag.
Definition: sql_plugin.cc:469
int check_func_set(THD *, SYS_VAR *var, void *save, st_mysql_value *value)
Definition: sql_plugin_var.cc:713
void update_func_int(THD *, SYS_VAR *, void *tgt, const void *save)
Definition: sql_plugin_var.cc:763
void update_func_str(THD *, SYS_VAR *, void *tgt, const void *save)
Definition: sql_plugin_var.cc:775
int check_func_longlong(THD *thd, SYS_VAR *var, void *save, st_mysql_value *value)
Definition: sql_plugin_var.cc:650
unsigned int * mysql_sys_var_uint(THD *thd, int offset)
Definition: sql_plugin_var.cc:1061
int item_val_int(st_mysql_value *value, long long *buf)
Definition: sql_plugin_var.cc:283
st_bookmark * register_var(const char *plugin, const char *name, int flags)
Definition: sql_plugin_var.cc:939
uchar * intern_sys_var_ptr(THD *thd, int offset, bool global_lock)
Definition: sql_plugin_var.cc:232
int check_func_int(THD *thd, SYS_VAR *var, void *save, st_mysql_value *value)
Definition: sql_plugin_var.cc:608
unsigned long long * mysql_sys_var_ulonglong(THD *thd, int offset)
Definition: sql_plugin_var.cc:1069
unsigned long * mysql_sys_var_ulong(THD *thd, int offset)
Definition: sql_plugin_var.cc:1065
int item_is_unsigned(st_mysql_value *value)
Definition: sql_plugin_var.cc:290
int check_func_double(THD *thd, SYS_VAR *var, void *save, st_mysql_value *value)
Definition: sql_plugin_var.cc:746
void convert_underscore_to_dash(char *str, size_t len)
Definition: sql_plugin_var.h:211
int item_val_real(st_mysql_value *value, double *buf)
Definition: sql_plugin_var.cc:295
int item_value_type(st_mysql_value *value)
Definition: sql_plugin_var.cc:258
char ** mysql_sys_var_str(THD *thd, int offset)
Definition: sql_plugin_var.cc:1073
void plugin_opt_set_limits(struct my_option *, const SYS_VAR *)
Definition: sql_plugin_var.cc:813
bool * mysql_sys_var_bool(THD *thd, int offset)
For correctness and simplicity's sake, a pointer to a function must be compatible with pointed-to typ...
Definition: sql_plugin_var.cc:1053
typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_int_t, int)
typedef DECLARE_MYSQL_SYSVAR_TYPELIB(sysvar_enum_t, unsigned long)
bool plugin_var_memalloc_global_update(THD *thd, SYS_VAR *var, char **dest, const char *value)
Set value for global variable with PLUGIN_VAR_MEMALLOC flag.
Definition: sql_plugin_var.cc:69
case opt name
Definition: sslopt-case.h:29
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
void * Alloc(size_t length)
Allocate memory.
Definition: my_alloc.h:145
Definition: plugin.h:69
MYSQL_PLUGIN_VAR_HEADER
Definition: plugin.h:70
Definition: typelib.h:35
Definition: my_getopt.h:83
char m_path_name[FN_REFLEN]
config file path OR compiled default values
Definition: my_getopt.h:87
enum enum_variable_source m_source
Definition: my_getopt.h:88
Definition: my_getopt.h:93
Definition: sql_plugin_var.h:173
int offset
Definition: sql_plugin_var.h:175
char key[1]
Definition: sql_plugin_var.h:177
uint version
Definition: sql_plugin_var.h:176
size_t name_len
Definition: sql_plugin_var.h:174
Definition: sql_plugin_var.h:327
Item * item
Definition: sql_plugin_var.h:328
Definition: system_variables_bits.h:94
Definition: sql_plugin_ref.h:45
Definition: set_var.h:82
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:39
#define PSI_NOT_INSTRUMENTED
Definition: validate_password_imp.cc:42