MySQL 9.1.0
Source Code Documentation
mysql_system_variable_reader_imp Class Reference

An implementation of mysql system_variable_reader for the mysql server component. More...

#include <mysql_system_variable_reader_imp.h>

Static Public Member Functions

static mysql_service_status_t get (THD *hthd, const char *variable_type, const char *component_name, const char *variable_name, void **val, size_t *out_length_of_val) noexcept
 Gets the value of a system variable. More...
 

Detailed Description

An implementation of mysql system_variable_reader for the mysql server component.

Member Function Documentation

◆ get()

mysql_service_status_t mysql_system_variable_reader_imp::get ( THD hthd,
const char *  variable_type,
const char *  component_name,
const char *  variable_name,
void **  val,
size_t *  out_length_of_val 
)
staticnoexcept

Gets the value of a system variable.

Works only for system variables taking integer or compatible values. Passing non-NULL THD 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 call to current_thd and gets the GLOBAL value of the variable. Passing NULL with SESSION type will gives error and returns.

Parameters
hthdthread session handle. if NULL, the GLOBAL value of the variable is returned.
variable_typeone of [GLOBAL, SESSION].
component_nameName of the component or "mysql_server" for the legacy ones.
variable_nameName of the variable
[in,out]valOn input: a buffer to hold the value. On output a pointer to the value.
[in,out]out_length_of_valOn input: the buffer size. On output the length of the data copied.
Return values
falsesuccess
TRUEfailure, error set. For error info, see THD if supplied.

The documentation for this class was generated from the following files: