MySQL 8.0.40
Source Code Documentation
|
Service to set the value of integer system variables. More...
#include <mysql_system_variable.h>
Public Attributes | |
mysql_service_status_t(* | set_signed )(MYSQL_THD thd, const char *variable_type, my_h_string variable_base, my_h_string variable_name, long long variable_value) |
Sets the value of a system variable to a new signed integer value. More... | |
mysql_service_status_t(* | set_unsigned )(MYSQL_THD thd, const char *variable_type, my_h_string variable_base, my_h_string variable_name, unsigned long long variable_value) |
Sets the value of a system variable to a new unsigned integer value. More... | |
Service to set the value of integer system variables.
Passing non-NULL THD input to setter methods means that the operation will be executed within the scope of existing transaction, thus any operation side effects impacting transaction itself (for example it may generate an SQL error that it stores into the current THD). If using existing THD, security context of the thread is checked to make sure that required privileges exist. Passing NULL makes a temporary THD created as a execution context (and destroyed afterwards), i.e. no impacts on existing transactions. It doesn't make sense to change SESSION variable on a temporary THD, so this operation will generate error.
This is an example of using the service:
mysql_service_status_t(* s_mysql_mysql_system_variable_update_integer::set_signed) (MYSQL_THD thd, const char *variable_type, my_h_string variable_base, my_h_string variable_name, long long variable_value) |
Sets the value of a system variable to a new signed integer value.
Uses long long type to store the data, this type size may differ on a different environments (32-bit vs 64-bit builds for example). This means that the user must ensure that component using this API was compiled using the same environment as for the server code.
thd | thread session handle. if NULL a temp one will be created and then removed. |
variable_type | One of GLOBAL, SESSION, PERSIST, PERSIST_ONLY. If NULL, then assumes GLOBAL. SESSION is not supported for a temporary THD. |
variable_base | a mysql string of the variable name prefix. NULL if none |
variable_name | MySQL string of the variable name |
variable_value | long long to set as value |
FALSE | success |
TRUE | failure, error set. For error info, see THD if supplied. |
mysql_service_status_t(* s_mysql_mysql_system_variable_update_integer::set_unsigned) (MYSQL_THD thd, const char *variable_type, my_h_string variable_base, my_h_string variable_name, unsigned long long variable_value) |
Sets the value of a system variable to a new unsigned integer value.
Uses unsigned long long type to store the data, this type size may differ on a different environments (32-bit vs 64-bit builds for example). This means that the user must ensure that component using this API was compiled using the same environment as for the server code.
thd | thread session handle. if NULL a temp one will be created and then removed. |
variable_type | One of GLOBAL, SESSION, PERSIST, PERSIST_ONLY. If NULL, then assumes GLOBAL. SESSION is not supported for a temporary THD. |
variable_base | a mysql string of the variable name prefix. NULL if none |
variable_name | MySQL string of the variable name |
variable_value | unsigned long long to set as value |
FALSE | success |
TRUE | failure, error set. For error info, see THD if supplied. |