Class to access the value of @global.gtid_mode in an efficient and thread-safe manner.
More...
#include <rpl_gtid.h>
Class to access the value of @global.gtid_mode in an efficient and thread-safe manner.
◆ value_type
Possible values for @global.gtid_mode.
Enumerator |
---|
OFF | New transactions are anonymous.
Replicated transactions must be anonymous; replicated GTID-transactions generate an error.
|
DEFAULT | |
OFF_PERMISSIVE | New transactions are anonyomus.
Replicated transactions can be either anonymous or GTID-transactions.
|
ON_PERMISSIVE | New transactions are GTID-transactions.
Replicated transactions can be either anonymous or GTID-transactions.
|
ON | New transactions are GTID-transactions.
Replicated transactions must be GTID-transactions; replicated anonymous transactions generate an error.
|
◆ Gtid_mode()
◆ from_string()
Return the given string gtid_mode as an enumeration value.
- Parameters
-
- Returns
- A pair, where the first component indicates failure and the second component is the GTID_MODE. Specifically, the first component is false if the string is a valid GTID_MODE, and true if it is not.
◆ get()
Return the current gtid_mode as an enumeration value.
◆ get_string()
const char * Gtid_mode::get_string |
( |
| ) |
const |
Return the current gtid_mode as a string.
Used only for debugging. Non-debug code typically reads and acts on the enum value before printing it. Then it is better to print the enum value.
◆ set()
Set a new value for @global.gtid_mode.
This should only be called from Sys_var_gtid_mode::global_update and gtid_server_init.
◆ to_string()
Return the given gtid_mode as a string.
◆ lock
Initial value:{
}
PSI_rwlock_key key_rwlock_gtid_mode_lock
Definition: mysqld.cc:1121
Protects updates to @global.gtid_mode.
SET @global.gtid_mode will try to take the write lock. If the lock is not granted immediately, SET will fail.
Thus, any other operation can block updates to @global.gtid_mode by acquiring the read lock.
◆ m_atomic_mode
std::atomic<int> Gtid_mode::m_atomic_mode |
|
private |
◆ names
const char * Gtid_mode::names |
|
static |
Initial value:= {"OFF", "OFF_PERMISSIVE", "ON_PERMISSIVE",
#define NullS
Definition of the null string (a null pointer of type char *), used in some of our string handling co...
Definition: nulls.h:33
Strings holding the enumeration values for gtid_mode.
Use Gtid_mode::get_string instead of accessing this directly.
◆ sysvar_mode
ulong Gtid_mode::sysvar_mode |
|
static |
The sys_var framework needs a variable of type ulong to store the value in.
The sys_var framework takes the value from there, but we copy it (in the methods of sys_var_gtid_mode) to the atomic value Gtid_mode::mode, and use only that in all other places.
The documentation for this class was generated from the following files: