MySQL 9.1.0
Source Code Documentation
|
#include "sql/persisted_variable.h"
#include "my_config.h"
#include <assert.h>
#include <ctype.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <algorithm>
#include <array>
#include <iomanip>
#include <memory>
#include <new>
#include <utility>
#include "mysql/components/library_mysys/my_hex_tools.h"
#include "keyring_operations_helper.h"
#include "lex_string.h"
#include "m_string.h"
#include "my_aes.h"
#include "my_compiler.h"
#include "my_default.h"
#include "my_getopt.h"
#include "my_io.h"
#include "my_macros.h"
#include "my_rnd.h"
#include "my_sys.h"
#include "my_thread.h"
#include "mysql/components/services/bits/psi_bits.h"
#include "mysql/components/services/bits/psi_file_bits.h"
#include "mysql/components/services/bits/psi_memory_bits.h"
#include "mysql/components/services/bits/psi_mutex_bits.h"
#include "mysql/components/services/log_builtins.h"
#include "mysql/components/services/log_shared.h"
#include "mysql/components/services/system_variable_source_type.h"
#include "mysql/my_loglevel.h"
#include "mysql/psi/mysql_file.h"
#include "mysql/psi/mysql_memory.h"
#include "mysql/psi/mysql_mutex.h"
#include "mysql/status_var.h"
#include "mysql/strings/m_ctype.h"
#include "mysql_version.h"
#include "mysqld_error.h"
#include "nulls.h"
#include "prealloced_array.h"
#include "scope_guard.h"
#include "sql-common/json_dom.h"
#include "sql/auth/auth_acls.h"
#include "sql/auth/auth_internal.h"
#include "sql/auth/sql_security_ctx.h"
#include "sql/current_thd.h"
#include "sql/debug_sync.h"
#include "sql/derror.h"
#include "sql/item.h"
#include "sql/log.h"
#include "sql/mysqld.h"
#include "sql/server_component/mysql_server_keyring_lockable_imp.h"
#include "sql/set_var.h"
#include "sql/sql_class.h"
#include "sql/sql_error.h"
#include "sql/sql_lex.h"
#include "sql/sql_list.h"
#include "sql/sql_show.h"
#include "sql/sys_vars_shared.h"
#include "sql/thr_malloc.h"
#include "sql_string.h"
#include "template_utils.h"
#include "thr_mutex.h"
#include "typelib.h"
Classes | |
struct | sort_tv_by_timestamp |
A comparison operator to sort persistent variables entries by timestamp. More... | |
Namespaces | |
namespace | anonymous_namespace{persisted_variable.cc} |
Functions | |
void | my_init_persist_psi_keys (void) |
CLASS Persisted_variables_cache Holds <name,value> pair of all options which needs to be persisted to a file. More... | |
std::string | anonymous_namespace{persisted_variable.cc}::tolower_varname (const char *name) |
static bool | check_boolean_value (const char *value, String &bool_str) |
For boolean variable types do validation on what value is set for the variable and then report error in case an invalid value is set. More... | |
static bool | format_json (const st_persist_var &entry, Json_object §ion_object) |
static bool | add_json_object (Json_object §ion_object, Json_object &json_object, const char *key_section) |
static bool | format_set (Persisted_variables_uset §ion, string key_section, Json_object &json_object) |
static bool | format_map (Persisted_variables_umap §ion, string key_section, Json_object &json_object) |
static bool | extract_variable_value_and_metadata (const Json_object *json_object, st_persist_var &output) |
static bool | extract_set (const Json_object &json_object, const std::string set_key, Persisted_variables_uset &output) |
static bool | extract_map (const Json_object &json_object, const std::string map_key, Persisted_variables_umap &output) |
static bool | extract_string (Json_object *obj, const std::string &key, std::string &value) |
|
static |
|
static |
For boolean variable types do validation on what value is set for the variable and then report error in case an invalid value is set.
[in] | value | Value which needs to be checked for. |
[out] | bool_str | Target String into which correct value needs to be stored after validation. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void my_init_persist_psi_keys | ( | void | ) |
CLASS Persisted_variables_cache Holds <name,value> pair of all options which needs to be persisted to a file.
When first SET PERSIST statement is executed we instantiate Persisted_variables_cache which loads the config file if present into m_persisted_dynamic_variables set. This is a singleton operation. m_persisted_dynamic_variables is an in-memory copy of config file itself. If the SET statement passes then this in-memory is updated and flushed to file as an atomic operation.
Next SET PERSIST statement would only update the in-memory copy and sync to config file instead of loading the file again.
|
static |
|
static |
|
static |
PSI_memory_key key_memory_persisted_variables |
PSI_mutex_key key_persist_file |
PSI_file_key key_persist_file_cnf |
PSI_mutex_key key_persist_variables |