MySQL  8.0.27
Source Code Documentation
persisted_variable.h File Reference
#include <stddef.h>
#include <map>
#include <string>
#include <unordered_set>
#include "my_alloc.h"
#include "my_inttypes.h"
#include "my_psi_config.h"
#include "mysql/components/services/bits/psi_bits.h"
#include "mysql/components/services/mysql_mutex_bits.h"
#include "mysql/psi/mysql_mutex.h"
#include "sql_string.h"

Go to the source code of this file.

Classes

struct  st_persist_var
 STRUCT st_persist_var. More...
 
struct  st_persist_var_hash
 STRUCT st_persist_var_hash. More...
 
class  Persisted_variables_cache
 

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...
 

Function Documentation

◆ my_init_persist_psi_keys()

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.

OVERVIEW

When first SET PERSIST statement is executed we instantiate Persisted_variables_cache which loads the config file if present into m_persist_variables set. This is a singleton operation. m_persist_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.