Go to the source code of this file.
◆ COPY_MYSQL_PLUGIN_VAR_HEADER
#define COPY_MYSQL_PLUGIN_VAR_HEADER |
( |
|
sys_var_type, |
|
|
|
type, |
|
|
|
sys_var_check, |
|
|
|
sys_var_update |
|
) |
| |
Value: sys_var_type->flags =
flags; \
sys_var_type->name = var_name; \
sys_var_type->check = check_func ? check_func : sys_var_check; \
sys_var_type->update = update_func ? update_func : sys_var_update; \
sys_var_type->value = (
type *)variable_value;
static int flags[50]
Definition: hp_test1.cc:40
#define comment
Definition: lexyy.cc:959
required string type
Definition: replication_group_member_actions.proto:34
◆ COPY_MYSQL_PLUGIN_VAR_REMAINING
#define COPY_MYSQL_PLUGIN_VAR_REMAINING |
( |
|
sys_var_type, |
|
|
|
check_arg_type |
|
) |
| |
Value: sys_var_type->def_val = check_arg_type->def_val; \
sys_var_type->min_val = check_arg_type->min_val; \
sys_var_type->max_val = check_arg_type->max_val; \
sys_var_type->blk_sz = check_arg_type->blk_sz;
◆ MYSQL_THD
◆ SYSVAR_BOOL_TYPE
#define SYSVAR_BOOL_TYPE |
( |
|
type | ) |
|
Value: struct sysvar_##
type##_type { \
MYSQL_PLUGIN_VAR_HEADER; \
bool *value; \
bool def_val; \
}
◆ SYSVAR_ENUM_TYPE
#define SYSVAR_ENUM_TYPE |
( |
|
type | ) |
|
Value: struct sysvar_##
type##_type { \
MYSQL_PLUGIN_VAR_HEADER; \
unsigned long *value; \
unsigned long def_val; \
TYPE_LIB *typelib; \
}
◆ SYSVAR_INTEGRAL_TYPE
#define SYSVAR_INTEGRAL_TYPE |
( |
|
type | ) |
|
Value: struct sysvar_##
type##_type { \
MYSQL_PLUGIN_VAR_HEADER; \
type *value; \
type def_val; \
type min_val; \
type max_val; \
type blk_sz; \
}
◆ SYSVAR_STR_TYPE
#define SYSVAR_STR_TYPE |
( |
|
type | ) |
|
Value: struct sysvar_##
type##_type { \
MYSQL_PLUGIN_VAR_HEADER; \
char **value; \
char *def_val; \
}
◆ mysql_sys_var_check_func
Signature for the check function.
This is called to check if the value supplied is valid and can be set as a new variable value at that time. It needs to extract the value supplied from the value API pointer. Note that extracting this value can be expensive (e.g. a scalar subquery) hence it should be done only once. This is why the result of this should be stored into the save output parameter so that it can be further reused by update() etc. For a multi-variable SET statement the server will first call all of the check functions and only if they all return success it will start calling the update functions. So the idea is that the update function should succeed no matter what. And all the necessary checks should be done in the check function. If you do not supply a check or update function the server will use the basic ones to check e.g. min and max values for the integer types etc.
- Parameters
-
| thd | The thread handle to the current thread |
| var | handle to the system variable definition |
[out] | save | placeholder for the value. This should be cast according to the type |
| value | Interface to extract the actual parameter value. |
- Returns
- status
- Return values
-
- See also
- mysql_sys_var_update_func, mysql_service_component_sys_variable_register_t
◆ mysql_sys_var_update_func
typedef void(* mysql_sys_var_update_func) (MYSQL_THD thd, SYS_VAR *var, void *val_ptr, const void *save) |
Signature for the update function.
This is called to set the updated value into the var_ptr placeholder and invoke any side effects that may stem from setting this system variable.
It receives the pre-calculated value (usually from mysql_sys_var_check_func) in the save pointer. It needs to set it into the var_ptr pointer and invoke any side effects.
For a multi-variable SET statement the server will first call all of the check functions and only if they all return success it will start calling the update functions. So the idea is that the update function should succeed no matter what. And all the necessary checks should be done in the check function. If you do not supply an update function the server will use the basic one to set the value according to the variable's type.
- Parameters
-
| thd | The thread handle to the current thread |
| var | handle to the system variable definition |
[out] | val_ptr | placeholder for the value. Store save in here. |
| save | The pre-calculated value from check. |
- See also
- mysql_sys_var_check_func, mysql_service_component_sys_variable_register_t