MySQL 8.4.3
Source Code Documentation
system_variables.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#include "my_base.h"
#include "my_inttypes.h"
#include "my_sqlcommand.h"
#include "my_thread_local.h"
#include "mysql/strings/m_ctype.h"
#include "sql/rpl_gtid.h"
#include "sql/sql_plugin_ref.h"

Go to the source code of this file.

Classes

struct  System_variables
 
struct  System_status_var
 Per thread status variables. More...
 

Macros

#define MODE_IGNORED_MASK
 
#define LAST_STATUS_VAR   secondary_engine_execution_count
 
#define FIRST_STATUS_VAR   created_tmp_disk_tables
 

Typedefs

using sql_mode_t = uint64_t
 

Enumerations

enum  enum_binlog_format { BINLOG_FORMAT_MIXED = 0 , BINLOG_FORMAT_STMT = 1 , BINLOG_FORMAT_ROW = 2 , BINLOG_FORMAT_UNSPEC }
 
enum  enum_rbr_exec_mode { RBR_EXEC_MODE_STRICT , RBR_EXEC_MODE_IDEMPOTENT , RBR_EXEC_MODE_LAST_BIT }
 
enum  enum_binlog_row_image { BINLOG_ROW_IMAGE_MINIMAL = 0 , BINLOG_ROW_IMAGE_NOBLOB = 1 , BINLOG_ROW_IMAGE_FULL = 2 }
 
enum  enum_binlog_row_value_options { PARTIAL_JSON_UPDATES = 1 }
 
enum  enum_binlog_row_metadata { BINLOG_ROW_METADATA_MINIMAL = 0 , BINLOG_ROW_METADATA_FULL = 1 }
 
enum  enum_session_track_gtids { SESSION_TRACK_GTIDS_OFF = 0 , SESSION_TRACK_GTIDS_OWN_GTID = 1 , SESSION_TRACK_GTIDS_ALL_GTIDS = 2 }
 
enum  use_secondary_engine { SECONDARY_ENGINE_OFF = 0 , SECONDARY_ENGINE_ON = 1 , SECONDARY_ENGINE_FORCED = 2 }
 Values for use_secondary_engine sysvar. More...
 
enum class  Explain_format_type : ulong { TRADITIONAL = 0 , TRADITIONAL_STRICT = 1 , TREE = 2 , JSON = 3 }
 Values for explain_format sysvar. More...
 

Functions

void add_diff_to_status (System_status_var *to_var, System_status_var *from_var, System_status_var *dec_var)
 
void add_to_status (System_status_var *to_var, System_status_var *from_var)
 
void reset_system_status_vars (System_status_var *status_vars)
 

Variables

constexpr sql_mode_t MODE_REAL_AS_FLOAT = 1
 
constexpr sql_mode_t MODE_PIPES_AS_CONCAT = 2
 
constexpr sql_mode_t MODE_ANSI_QUOTES = 4
 
constexpr sql_mode_t MODE_IGNORE_SPACE = 8
 
constexpr sql_mode_t MODE_NOT_USED = 16
 
constexpr sql_mode_t MODE_ONLY_FULL_GROUP_BY = 32
 
constexpr sql_mode_t MODE_NO_UNSIGNED_SUBTRACTION = 64
 
constexpr sql_mode_t MODE_NO_DIR_IN_CREATE = 128
 
constexpr sql_mode_t MODE_ANSI = 0x40000
 
constexpr sql_mode_t MODE_NO_AUTO_VALUE_ON_ZERO = MODE_ANSI * 2
 
constexpr sql_mode_t MODE_NO_BACKSLASH_ESCAPES
 
constexpr sql_mode_t MODE_STRICT_TRANS_TABLES
 
constexpr sql_mode_t MODE_STRICT_ALL_TABLES
 
constexpr sql_mode_t MODE_NO_ZERO_IN_DATE = MODE_STRICT_ALL_TABLES * 2
 
constexpr sql_mode_t MODE_NO_ZERO_DATE = MODE_NO_ZERO_IN_DATE * 2
 
constexpr sql_mode_t MODE_INVALID_DATES = MODE_NO_ZERO_DATE * 2
 
constexpr sql_mode_t MODE_ERROR_FOR_DIVISION_BY_ZERO
 
constexpr sql_mode_t MODE_TRADITIONAL
 
constexpr sql_mode_t MODE_HIGH_NOT_PRECEDENCE = 1ULL << 29
 
constexpr sql_mode_t MODE_NO_ENGINE_SUBSTITUTION
 
constexpr sql_mode_t MODE_PAD_CHAR_TO_FULL_LENGTH = 1ULL << 31
 
constexpr sql_mode_t MODE_TIME_TRUNCATE_FRACTIONAL = 1ULL << 32
 
constexpr sql_mode_t MODE_LAST = 1ULL << 33
 
constexpr sql_mode_t MODE_ALLOWED_MASK
 
const int COUNT_GLOBAL_STATUS_VARS
 

Macro Definition Documentation

◆ FIRST_STATUS_VAR

#define FIRST_STATUS_VAR   created_tmp_disk_tables

◆ LAST_STATUS_VAR

#define LAST_STATUS_VAR   secondary_engine_execution_count

◆ MODE_IGNORED_MASK

#define MODE_IGNORED_MASK
Value:
(0x00100 | /* was: MODE_POSTGRESQL */ \
0x00200 | /* was: MODE_ORACLE */ \
0x00400 | /* was: MODE_MSSQL */ \
0x00800 | /* was: MODE_DB2 */ \
0x01000 | /* was: MODE_MAXDB */ \
0x02000 | /* was: MODE_NO_KEY_OPTIONS */ \
0x04000 | /* was: MODE_NO_TABLE_OPTIONS */ \
0x08000 | /* was: MODE_NO_FIELD_OPTIONS */ \
0x10000 | /* was: MODE_MYSQL323 */ \
0x20000 | /* was: MODE_MYSQL40 */ \
0x10000000 /* was: MODE_NO_AUTO_CREATE_USER */ \
)

Typedef Documentation

◆ sql_mode_t

using sql_mode_t = uint64_t

Enumeration Type Documentation

◆ enum_binlog_format

Enumerator
BINLOG_FORMAT_MIXED 

statement if safe, otherwise row - autodetected

BINLOG_FORMAT_STMT 

statement-based

BINLOG_FORMAT_ROW 

row-based

BINLOG_FORMAT_UNSPEC 

thd_binlog_format() returns it when binlog is closed

◆ enum_binlog_row_image

Enumerator
BINLOG_ROW_IMAGE_MINIMAL 

PKE in the before image and changed columns in the after image.

BINLOG_ROW_IMAGE_NOBLOB 

Whenever possible, before and after image contain all columns except blobs.

BINLOG_ROW_IMAGE_FULL 

All columns in both before and after image.

◆ enum_binlog_row_metadata

Enumerator
BINLOG_ROW_METADATA_MINIMAL 
BINLOG_ROW_METADATA_FULL 

◆ enum_binlog_row_value_options

Enumerator
PARTIAL_JSON_UPDATES 

Store JSON updates in partial form.

◆ enum_rbr_exec_mode

Enumerator
RBR_EXEC_MODE_STRICT 
RBR_EXEC_MODE_IDEMPOTENT 
RBR_EXEC_MODE_LAST_BIT 

◆ enum_session_track_gtids

Enumerator
SESSION_TRACK_GTIDS_OFF 
SESSION_TRACK_GTIDS_OWN_GTID 
SESSION_TRACK_GTIDS_ALL_GTIDS 

◆ Explain_format_type

enum class Explain_format_type : ulong
strong

Values for explain_format sysvar.

The value "TRADITIONAL_STRICT" is meant only to be used by the mtr test suite. With hypergraph optimizer, if explain_format value is TRADITIONAL, EXPLAIN without a format specifier prints in TREE format. The mtr tests were written before this traditional-tree conversion was introduced. So mtr was designed to just ignore the "format not supported with hypergraph" error when a test runs an EXPLAIN without format specifier with –hypergraph. With the conversion introduced, EXPLAIN without format specifier therefore would have output in different formats with and without the mtr –hypergraph option. In order for the mtr tests to be able to continue to pass, mtr internally sets explain_format to TRADITIONAL_STRICT so that these statements continue to error out rather than print TREE format as they would do with TRADITIONAL format. This is a temporary stuff. Once all tests start using TREE format, we will deprecate this value.

Enumerator
TRADITIONAL 
TRADITIONAL_STRICT 
TREE 
JSON 

◆ use_secondary_engine

Values for use_secondary_engine sysvar.

Enumerator
SECONDARY_ENGINE_OFF 
SECONDARY_ENGINE_ON 
SECONDARY_ENGINE_FORCED 

Function Documentation

◆ add_diff_to_status()

void add_diff_to_status ( System_status_var to_var,
System_status_var from_var,
System_status_var dec_var 
)

◆ add_to_status()

void add_to_status ( System_status_var to_var,
System_status_var from_var 
)

◆ reset_system_status_vars()

void reset_system_status_vars ( System_status_var status_vars)

Variable Documentation

◆ COUNT_GLOBAL_STATUS_VARS

const int COUNT_GLOBAL_STATUS_VARS
Initial value:
=
sizeof(ulonglong)) +
1
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Per thread status variables.
Definition: system_variables.h:525
#define LAST_STATUS_VAR
Definition: system_variables.h:606
#define FIRST_STATUS_VAR
Definition: system_variables.h:613

◆ MODE_ALLOWED_MASK

constexpr sql_mode_t MODE_ALLOWED_MASK
inlineconstexpr
Initial value:
=
constexpr sql_mode_t MODE_NO_ENGINE_SUBSTITUTION
Definition: system_variables.h:154
constexpr sql_mode_t MODE_NOT_USED
Definition: system_variables.h:127
constexpr sql_mode_t MODE_INVALID_DATES
Definition: system_variables.h:148
constexpr sql_mode_t MODE_NO_BACKSLASH_ESCAPES
Definition: system_variables.h:133
constexpr sql_mode_t MODE_NO_UNSIGNED_SUBTRACTION
Definition: system_variables.h:129
constexpr sql_mode_t MODE_TRADITIONAL
Definition: system_variables.h:151
constexpr sql_mode_t MODE_TIME_TRUNCATE_FRACTIONAL
Definition: system_variables.h:161
constexpr sql_mode_t MODE_NO_ZERO_IN_DATE
Definition: system_variables.h:146
constexpr sql_mode_t MODE_ONLY_FULL_GROUP_BY
Definition: system_variables.h:128
constexpr sql_mode_t MODE_ERROR_FOR_DIVISION_BY_ZERO
Definition: system_variables.h:149
constexpr sql_mode_t MODE_STRICT_TRANS_TABLES
Definition: system_variables.h:135
constexpr sql_mode_t MODE_PIPES_AS_CONCAT
Definition: system_variables.h:124
constexpr sql_mode_t MODE_NO_AUTO_VALUE_ON_ZERO
Definition: system_variables.h:132
constexpr sql_mode_t MODE_NO_ZERO_DATE
Definition: system_variables.h:147
constexpr sql_mode_t MODE_REAL_AS_FLOAT
Definition: system_variables.h:123
constexpr sql_mode_t MODE_NO_DIR_IN_CREATE
Definition: system_variables.h:130
constexpr sql_mode_t MODE_STRICT_ALL_TABLES
Definition: system_variables.h:137
constexpr sql_mode_t MODE_PAD_CHAR_TO_FULL_LENGTH
Definition: system_variables.h:156
constexpr sql_mode_t MODE_ANSI
Definition: system_variables.h:131
constexpr sql_mode_t MODE_IGNORE_SPACE
Definition: system_variables.h:126
constexpr sql_mode_t MODE_HIGH_NOT_PRECEDENCE
Definition: system_variables.h:153
constexpr sql_mode_t MODE_ANSI_QUOTES
Definition: system_variables.h:125

◆ MODE_ANSI

constexpr sql_mode_t MODE_ANSI = 0x40000
inlineconstexpr

◆ MODE_ANSI_QUOTES

constexpr sql_mode_t MODE_ANSI_QUOTES = 4
inlineconstexpr

◆ MODE_ERROR_FOR_DIVISION_BY_ZERO

constexpr sql_mode_t MODE_ERROR_FOR_DIVISION_BY_ZERO
inlineconstexpr
Initial value:

◆ MODE_HIGH_NOT_PRECEDENCE

constexpr sql_mode_t MODE_HIGH_NOT_PRECEDENCE = 1ULL << 29
inlineconstexpr

◆ MODE_IGNORE_SPACE

constexpr sql_mode_t MODE_IGNORE_SPACE = 8
inlineconstexpr

◆ MODE_INVALID_DATES

constexpr sql_mode_t MODE_INVALID_DATES = MODE_NO_ZERO_DATE * 2
inlineconstexpr

◆ MODE_LAST

constexpr sql_mode_t MODE_LAST = 1ULL << 33
inlineconstexpr

◆ MODE_NO_AUTO_VALUE_ON_ZERO

constexpr sql_mode_t MODE_NO_AUTO_VALUE_ON_ZERO = MODE_ANSI * 2
inlineconstexpr

◆ MODE_NO_BACKSLASH_ESCAPES

constexpr sql_mode_t MODE_NO_BACKSLASH_ESCAPES
inlineconstexpr
Initial value:

◆ MODE_NO_DIR_IN_CREATE

constexpr sql_mode_t MODE_NO_DIR_IN_CREATE = 128
inlineconstexpr

◆ MODE_NO_ENGINE_SUBSTITUTION

constexpr sql_mode_t MODE_NO_ENGINE_SUBSTITUTION
inlineconstexpr
Initial value:

◆ MODE_NO_UNSIGNED_SUBTRACTION

constexpr sql_mode_t MODE_NO_UNSIGNED_SUBTRACTION = 64
inlineconstexpr

◆ MODE_NO_ZERO_DATE

constexpr sql_mode_t MODE_NO_ZERO_DATE = MODE_NO_ZERO_IN_DATE * 2
inlineconstexpr

◆ MODE_NO_ZERO_IN_DATE

constexpr sql_mode_t MODE_NO_ZERO_IN_DATE = MODE_STRICT_ALL_TABLES * 2
inlineconstexpr

◆ MODE_NOT_USED

constexpr sql_mode_t MODE_NOT_USED = 16
inlineconstexpr

◆ MODE_ONLY_FULL_GROUP_BY

constexpr sql_mode_t MODE_ONLY_FULL_GROUP_BY = 32
inlineconstexpr

◆ MODE_PAD_CHAR_TO_FULL_LENGTH

constexpr sql_mode_t MODE_PAD_CHAR_TO_FULL_LENGTH = 1ULL << 31
inlineconstexpr

◆ MODE_PIPES_AS_CONCAT

constexpr sql_mode_t MODE_PIPES_AS_CONCAT = 2
inlineconstexpr

◆ MODE_REAL_AS_FLOAT

constexpr sql_mode_t MODE_REAL_AS_FLOAT = 1
inlineconstexpr

◆ MODE_STRICT_ALL_TABLES

constexpr sql_mode_t MODE_STRICT_ALL_TABLES
inlineconstexpr
Initial value:

◆ MODE_STRICT_TRANS_TABLES

constexpr sql_mode_t MODE_STRICT_TRANS_TABLES
inlineconstexpr
Initial value:

◆ MODE_TIME_TRUNCATE_FRACTIONAL

constexpr sql_mode_t MODE_TIME_TRUNCATE_FRACTIONAL = 1ULL << 32
inlineconstexpr

◆ MODE_TRADITIONAL

constexpr sql_mode_t MODE_TRADITIONAL
inlineconstexpr
Initial value: