Go to the source code of this file.
◆ MYSQL_THD
◆ 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