MySQL 8.0.40
Source Code Documentation
s_mysql_mysql_system_variable_update_default Struct Reference

Service to set the default value of system variables. More...

#include <mysql_system_variable.h>

Public Attributes

mysql_service_status_t(* set )(MYSQL_THD thd, const char *variable_type, my_h_string variable_base, my_h_string variable_name)
 Sets the value of a system variable to its default value. More...
 

Detailed Description

Service to set the default value of system variables.

This is an example of using the service:

MYSQL_THD thd = nullptr;
if (!make_new_thread &&
mysql_service_mysql_current_thread_reader->get(&thd)) {
*error = 1;
return 0;
}
const char *cs = "latin1";
const char *base_input = "my_component"; //nullptr if not a component variable
const char *name_input = "my_variable";
const char *type = "PERSIST";
my_h_string base = nullptr, name = nullptr;
if ((base != nullptr &&
mysql_service_mysql_string_converter->convert_from_buffer(
&base, base_input, strlen(base_input), cs)) ||
mysql_service_mysql_string_converter->convert_from_buffer(
&name, name_input, strlen(name_input), cs)) {
if (base) mysql_service_mysql_string_factory->destroy(base);
if (name) mysql_service_mysql_string_factory->destroy(name);
*error = 1;
return 0;
}
if (mysql_service_mysql_system_variable_update_default->set(
thd, type, base, name))
*error = 1;
if (base) mysql_service_mysql_string_factory->destroy(base);
if (name) mysql_service_mysql_string_factory->destroy(name);
#define MYSQL_THD
Definition: backup_page_tracker.h:38
Definition: commit_order_queue.h:34
required string type
Definition: replication_group_member_actions.proto:34
case opt name
Definition: sslopt-case.h:33
Definition: mysql_string_service.cc:59
See also
mysql_system_variable_update_imp

Member Data Documentation

◆ set

mysql_service_status_t(* s_mysql_mysql_system_variable_update_default::set) (MYSQL_THD thd, const char *variable_type, my_h_string variable_base, my_h_string variable_name)

Sets the value of a system variable to its default value.

See also
Component Services Inventory
Parameters
thdthread session handle. if NULL a temp one will be created and then removed.
variable_typeOne of GLOBAL, SESSION, PERSIST, PERSIST_ONLY. If NULL, then assumes GLOBAL. SESSION is not supported for a temporary THD.
variable_basea mysql string of the variable name prefix. NULL if none
variable_nameMySQL string of the variable name
Return values
FALSEsuccess
TRUEfailure, error set. For error info, see THD if supplied.

The documentation for this struct was generated from the following file: