MySQL 8.0.40
Source Code Documentation
system_variables.h File Reference
#include <stddef.h>
#include <sys/types.h>
#include "m_ctype.h"
#include "my_base.h"
#include "my_inttypes.h"
#include "my_sqlcommand.h"
#include "my_thread_local.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_REAL_AS_FLOAT   1
 
#define MODE_PIPES_AS_CONCAT   2
 
#define MODE_ANSI_QUOTES   4
 
#define MODE_IGNORE_SPACE   8
 
#define MODE_NOT_USED   16
 
#define MODE_ONLY_FULL_GROUP_BY   32
 
#define MODE_NO_UNSIGNED_SUBTRACTION   64
 
#define MODE_NO_DIR_IN_CREATE   128
 
#define MODE_ANSI   262144L
 
#define MODE_NO_AUTO_VALUE_ON_ZERO   (MODE_ANSI * 2)
 
#define MODE_NO_BACKSLASH_ESCAPES   (MODE_NO_AUTO_VALUE_ON_ZERO * 2)
 
#define MODE_STRICT_TRANS_TABLES   (MODE_NO_BACKSLASH_ESCAPES * 2)
 
#define MODE_STRICT_ALL_TABLES   (MODE_STRICT_TRANS_TABLES * 2)
 
#define MODE_NO_ZERO_IN_DATE   (MODE_STRICT_ALL_TABLES * 2)
 
#define MODE_NO_ZERO_DATE   (MODE_NO_ZERO_IN_DATE * 2)
 
#define MODE_INVALID_DATES   (MODE_NO_ZERO_DATE * 2)
 
#define MODE_ERROR_FOR_DIVISION_BY_ZERO   (MODE_INVALID_DATES * 2)
 
#define MODE_TRADITIONAL   (MODE_ERROR_FOR_DIVISION_BY_ZERO * 2)
 
#define MODE_HIGH_NOT_PRECEDENCE   (1ULL << 29)
 
#define MODE_NO_ENGINE_SUBSTITUTION   (MODE_HIGH_NOT_PRECEDENCE * 2)
 
#define MODE_PAD_CHAR_TO_FULL_LENGTH   (1ULL << 31)
 
#define MODE_TIME_TRUNCATE_FRACTIONAL   (1ULL << 32)
 
#define MODE_LAST   (1ULL << 33)
 
#define MODE_ALLOWED_MASK
 
#define MODE_IGNORED_MASK
 
#define LAST_STATUS_VAR   secondary_engine_execution_count
 
#define FIRST_STATUS_VAR   created_tmp_disk_tables
 

Typedefs

typedef ulonglong sql_mode_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_transaction_write_set_hashing_algorithm { HASH_ALGORITHM_OFF = 0 , HASH_ALGORITHM_MURMUR32 = 1 , HASH_ALGORITHM_XXHASH64 = 2 }
 
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

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_ALLOWED_MASK

#define MODE_ALLOWED_MASK
Value:
MODE_IGNORE_SPACE | MODE_NOT_USED | MODE_ONLY_FULL_GROUP_BY | \
MODE_NO_UNSIGNED_SUBTRACTION | MODE_NO_DIR_IN_CREATE | MODE_ANSI | \
MODE_NO_AUTO_VALUE_ON_ZERO | MODE_NO_BACKSLASH_ESCAPES | \
MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES | MODE_NO_ZERO_IN_DATE | \
MODE_PAD_CHAR_TO_FULL_LENGTH | MODE_TIME_TRUNCATE_FRACTIONAL)
#define MODE_ANSI
Definition: system_variables.h:137
#define MODE_NO_ZERO_IN_DATE
Definition: system_variables.h:149
#define MODE_ERROR_FOR_DIVISION_BY_ZERO
Definition: system_variables.h:152
#define MODE_NO_DIR_IN_CREATE
Definition: system_variables.h:136
#define MODE_HIGH_NOT_PRECEDENCE
Definition: system_variables.h:154
#define MODE_ANSI_QUOTES
Definition: system_variables.h:131
#define MODE_REAL_AS_FLOAT
Definition: system_variables.h:129
#define MODE_PIPES_AS_CONCAT
Definition: system_variables.h:130
#define MODE_TIME_TRUNCATE_FRACTIONAL
Definition: system_variables.h:161
#define MODE_NO_BACKSLASH_ESCAPES
Definition: system_variables.h:139
#define MODE_NO_ENGINE_SUBSTITUTION
Definition: system_variables.h:155
#define MODE_ONLY_FULL_GROUP_BY
Definition: system_variables.h:134
#define MODE_STRICT_ALL_TABLES
Definition: system_variables.h:141
#define MODE_NOT_USED
Definition: system_variables.h:133
#define MODE_INVALID_DATES
Definition: system_variables.h:151

◆ MODE_ANSI

#define MODE_ANSI   262144L

◆ MODE_ANSI_QUOTES

#define MODE_ANSI_QUOTES   4

◆ MODE_ERROR_FOR_DIVISION_BY_ZERO

#define MODE_ERROR_FOR_DIVISION_BY_ZERO   (MODE_INVALID_DATES * 2)

◆ MODE_HIGH_NOT_PRECEDENCE

#define MODE_HIGH_NOT_PRECEDENCE   (1ULL << 29)

◆ MODE_IGNORE_SPACE

#define MODE_IGNORE_SPACE   8

◆ 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 */ \
)

◆ MODE_INVALID_DATES

#define MODE_INVALID_DATES   (MODE_NO_ZERO_DATE * 2)

◆ MODE_LAST

#define MODE_LAST   (1ULL << 33)

◆ MODE_NO_AUTO_VALUE_ON_ZERO

#define MODE_NO_AUTO_VALUE_ON_ZERO   (MODE_ANSI * 2)

◆ MODE_NO_BACKSLASH_ESCAPES

#define MODE_NO_BACKSLASH_ESCAPES   (MODE_NO_AUTO_VALUE_ON_ZERO * 2)

◆ MODE_NO_DIR_IN_CREATE

#define MODE_NO_DIR_IN_CREATE   128

◆ MODE_NO_ENGINE_SUBSTITUTION

#define MODE_NO_ENGINE_SUBSTITUTION   (MODE_HIGH_NOT_PRECEDENCE * 2)

◆ MODE_NO_UNSIGNED_SUBTRACTION

#define MODE_NO_UNSIGNED_SUBTRACTION   64

◆ MODE_NO_ZERO_DATE

#define MODE_NO_ZERO_DATE   (MODE_NO_ZERO_IN_DATE * 2)

◆ MODE_NO_ZERO_IN_DATE

#define MODE_NO_ZERO_IN_DATE   (MODE_STRICT_ALL_TABLES * 2)

◆ MODE_NOT_USED

#define MODE_NOT_USED   16

◆ MODE_ONLY_FULL_GROUP_BY

#define MODE_ONLY_FULL_GROUP_BY   32

◆ MODE_PAD_CHAR_TO_FULL_LENGTH

#define MODE_PAD_CHAR_TO_FULL_LENGTH   (1ULL << 31)

◆ MODE_PIPES_AS_CONCAT

#define MODE_PIPES_AS_CONCAT   2

◆ MODE_REAL_AS_FLOAT

#define MODE_REAL_AS_FLOAT   1

◆ MODE_STRICT_ALL_TABLES

#define MODE_STRICT_ALL_TABLES   (MODE_STRICT_TRANS_TABLES * 2)

◆ MODE_STRICT_TRANS_TABLES

#define MODE_STRICT_TRANS_TABLES   (MODE_NO_BACKSLASH_ESCAPES * 2)

◆ MODE_TIME_TRUNCATE_FRACTIONAL

#define MODE_TIME_TRUNCATE_FRACTIONAL   (1ULL << 32)

◆ MODE_TRADITIONAL

#define MODE_TRADITIONAL   (MODE_ERROR_FOR_DIVISION_BY_ZERO * 2)

Typedef Documentation

◆ sql_mode_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 

◆ enum_transaction_write_set_hashing_algorithm

Enumerator
HASH_ALGORITHM_OFF 
HASH_ALGORITHM_MURMUR32 
HASH_ALGORITHM_XXHASH64 

◆ 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:511
#define LAST_STATUS_VAR
Definition: system_variables.h:592
#define FIRST_STATUS_VAR
Definition: system_variables.h:599