MySQL 8.3.0
Source Code Documentation
Command_names Class Reference

Map from enumeration values of type enum_server_command to descriptions of type std::string. More...

#include <sql_parse.h>

Static Public Member Functions

static const std::string & str_notranslate (enum_server_command cmd)
 Return a description string for a given enum_server_command. More...
 
static const std::string & str_notranslate (int cmd)
 Return a description string for an integer that is the numeric value of an enum_server_command. More...
 
static const std::string & str_session (enum_server_command cmd)
 Return a description string for a given enum_server_command. More...
 
static const std::string & str_global (enum_server_command cmd)
 Return a description string for a given enum_server_command. More...
 
static const std::string & str_session (int cmd)
 Return a description string for an integer that is the numeric value of an enum_server_command. More...
 

Static Private Member Functions

static const std::string & translate (const System_variables &sysvars)
 Given a system_variable object, returns the string to use for m_replace_com, according to the setting of terminology_use_previous stored in the object. More...
 
static enum_server_command int_to_cmd (int cmd)
 Cast an integer to enum_server_command, and assert it is in range. More...
 

Static Private Attributes

static const std::string m_names []
 Array indexed by enum_server_command, where each element is a description string. More...
 
static constexpr enum_server_command m_replace_com {COM_REGISTER_SLAVE}
 Command whose name depends on @terminology_use_previous. More...
 
static const std::string m_replace_str {"Register Slave"}
 Name to use when compatibility is enabled. More...
 
static constexpr terminology_use_previous::enum_compatibility_version m_replace_version {terminology_use_previous::BEFORE_8_0_26}
 The version when the name was changed. More...
 

Detailed Description

Map from enumeration values of type enum_server_command to descriptions of type std::string.

In this context, a "command" is a type code for a remote procedure call in the client-server protocol; for instance, a "connect" or a "ping" or a "query".

The getter functions use @terminology_use_previous to decide which version of the name to use, for names that depend on it.

Member Function Documentation

◆ int_to_cmd()

static enum_server_command Command_names::int_to_cmd ( int  cmd)
inlinestaticprivate

Cast an integer to enum_server_command, and assert it is in range.

Parameters
cmdThe integer value
Returns
The enum_server_command

◆ str_notranslate() [1/2]

static const std::string & Command_names::str_notranslate ( enum_server_command  cmd)
inlinestatic

Return a description string for a given enum_server_command.

This bypasses @terminology_use_previous and acts as if it was set to NONE.

Parameters
cmdThe enum_server_command
Return values
Thedescription string

◆ str_notranslate() [2/2]

static const std::string & Command_names::str_notranslate ( int  cmd)
inlinestatic

Return a description string for an integer that is the numeric value of an enum_server_command.

This bypasses @terminology_use_previous and acts as if it was set to NONE.

Parameters
cmdThe integer value
Return values
Thedescription string

◆ str_session()

static const std::string & Command_names::str_session ( int  cmd)
inlinestatic

Return a description string for an integer that is the numeric value of an enum_server_command.

This takes @session.terminology_use_previous into account, and returns an old name if one has been defined and the option is enabled.

Parameters
cmdThe integer value
Return values
Thedescription string

Member Data Documentation

◆ m_replace_com

constexpr enum_server_command Command_names::m_replace_com {COM_REGISTER_SLAVE}
staticconstexprprivate

Command whose name depends on @terminology_use_previous.

Currently, there is only one such command, so we use a single member variable. In case we ever change any other command name and control the use of the old or new name using @terminology_use_previous, we need to change the following three members into some collection type, e.g., std::unordered_set.

◆ m_replace_version

constexpr terminology_use_previous::enum_compatibility_version Command_names::m_replace_version {terminology_use_previous::BEFORE_8_0_26}
staticconstexprprivate

The version when the name was changed.


The documentation for this class was generated from the following files: