MySQL 8.4.3
Source Code Documentation
server_mock Namespace Reference

Classes

class  Acceptor
 
struct  AsyncNotice
 
class  DukHeap
 memory heap of duk contexts. More...
 
class  DukHeapPool
 
class  DuktapeRuntimeError
 
class  DuktapeStatementReader
 
class  DuktapeStatementReaderFactory
 
class  MySQLClassicProtocol
 
class  MySQLServerMock
 Main class. More...
 
class  MySQLServerMockSession
 
class  MySQLServerMockSessionClassic
 
class  MySQLServerMockSessionX
 
class  MySQLXProtocol
 
class  ProtocolBase
 
struct  ResultsetResponse
 Keeps result data for single SQL statement that returns resultset. More...
 
class  StatementReaderBase
 
class  XProtocolDecoder
 
class  XProtocolEncoder
 

Typedefs

using RowValueType = std::vector< std::optional< std::string > >
 Vector for keeping has_value|string representation of the values of the single row (ordered by column) More...
 
using session_tracker_field = std::variant< classic_protocol::session_track::TransactionCharacteristics, classic_protocol::session_track::TransactionState, classic_protocol::session_track::SystemVariable, classic_protocol::session_track::Schema, classic_protocol::session_track::State, classic_protocol::session_track::Gtid >
 
using OkResponse = classic_protocol::message::server::Ok
 
using ErrorResponse = classic_protocol::message::server::Error
 

Enumerations

enum class  MySQLColumnType {
  DECIMAL = 0x00 , TINY = 0x01 , SHORT = 0x02 , LONG = 0x03 ,
  FLOAT = 0x04 , DOUBLE = 0x05 , NULL_ = 0x06 , TIMESTAMP = 0x07 ,
  LONGLONG = 0x08 , INT24 = 0x09 , DATE = 0x0a , TIME = 0x0b ,
  DATETIME = 0x0c , YEAR = 0x0d , NEWDATE = 0x0e , VARCHAR = 0x0f ,
  BIT = 0x10 , TIMESTAMP2 = 0x11 , JSON = 0xf5 , NEWDECIMAL = 0xf6 ,
  ENUM = 0xf7 , SET = 0xf8 , TINY_BLOB = 0xf9 , MEDIUM_BLOB = 0xfa ,
  LONG_BLOB = 0xfb , BLOB = 0xfc , VAR_STRING = 0xfd , STRING = 0xfe ,
  GEOMETRY = 0xff
}
 Supported MySQL Coumn types. More...
 

Functions

template<class Rep , class Period >
static std::string duration_to_us_string (const std::chrono::duration< Rep, Period > &dur)
 
stdx::expected< std::string, std::error_code > cert_get_name (X509_NAME *name)
 
stdx::expected< std::string, std::error_code > cert_get_subject_name (X509 *cert)
 
stdx::expected< std::string, std::error_code > cert_get_issuer_name (X509 *cert)
 
template<class T >
constexpr uint8_t type_byte ()
 
template<class T >
std::string encode_session_tracker (const T &tracker)
 
std::string encode_session_trackers (const std::vector< session_tracker_field > &trackers)
 
static duk_int_t process_get_shared (duk_context *ctx)
 
static duk_int_t process_set_shared (duk_context *ctx)
 
static duk_int_t process_get_keys (duk_context *ctx)
 
static void check_stmts_section (duk_context *ctx)
 
static bool check_notices_section (duk_context *ctx)
 
static void check_handshake_section (duk_context *ctx)
 
static duk_int_t process_erase (duk_context *ctx)
 
duk_int_t duk_pcompile_file (duk_context *ctx, const char *path, int compile_type)
 
static std::string duk_get_type_names (duk_context *ctx, duk_idx_t ndx)
 
MySQLColumnType column_type_from_string (const std::string &type)
 
static void check_handshake_greeting_exectime (duk_context *ctx)
 
static void check_handshake_object (duk_context *ctx)
 
static classic_protocol::message::server::Greeting default_server_greeting ()
 
template<class Rep , class Period >
static std::string duration_to_us_string (const std::chrono::duration< Rep, Period > &dur)
 

Typedef Documentation

◆ ErrorResponse

◆ OkResponse

◆ RowValueType

using server_mock::RowValueType = typedef std::vector<std::optional<std::string> >

Vector for keeping has_value|string representation of the values of the single row (ordered by column)

◆ session_tracker_field

Enumeration Type Documentation

◆ MySQLColumnType

enum class server_mock::MySQLColumnType
strong

Supported MySQL Coumn types.

Enumerator
DECIMAL 
TINY 
SHORT 
LONG 
FLOAT 
DOUBLE 
NULL_ 
TIMESTAMP 
LONGLONG 
INT24 
DATE 
TIME 
DATETIME 
YEAR 
NEWDATE 
VARCHAR 
BIT 
TIMESTAMP2 
JSON 
NEWDECIMAL 
ENUM 
SET 
TINY_BLOB 
MEDIUM_BLOB 
LONG_BLOB 
BLOB 
VAR_STRING 
STRING 
GEOMETRY 

Function Documentation

◆ cert_get_issuer_name()

stdx::expected< std::string, std::error_code > server_mock::cert_get_issuer_name ( X509 *  cert)

◆ cert_get_name()

stdx::expected< std::string, std::error_code > server_mock::cert_get_name ( X509_NAME *  name)

◆ cert_get_subject_name()

stdx::expected< std::string, std::error_code > server_mock::cert_get_subject_name ( X509 *  cert)

◆ check_handshake_greeting_exectime()

static void server_mock::check_handshake_greeting_exectime ( duk_context *  ctx)
static

◆ check_handshake_object()

static void server_mock::check_handshake_object ( duk_context *  ctx)
static

◆ check_handshake_section()

static void server_mock::check_handshake_section ( duk_context *  ctx)
static

◆ check_notices_section()

static bool server_mock::check_notices_section ( duk_context *  ctx)
static

◆ check_stmts_section()

static void server_mock::check_stmts_section ( duk_context *  ctx)
static

◆ column_type_from_string()

MySQLColumnType server_mock::column_type_from_string ( const std::string &  type)

◆ default_server_greeting()

static classic_protocol::message::server::Greeting server_mock::default_server_greeting ( )
static

◆ duk_get_type_names()

static std::string server_mock::duk_get_type_names ( duk_context *  ctx,
duk_idx_t  ndx 
)
static

◆ duk_pcompile_file()

duk_int_t server_mock::duk_pcompile_file ( duk_context *  ctx,
const char *  path,
int  compile_type 
)

◆ duration_to_us_string() [1/2]

template<class Rep , class Period >
static std::string server_mock::duration_to_us_string ( const std::chrono::duration< Rep, Period > &  dur)
static

◆ duration_to_us_string() [2/2]

template<class Rep , class Period >
static std::string server_mock::duration_to_us_string ( const std::chrono::duration< Rep, Period > &  dur)
static

◆ encode_session_tracker()

template<class T >
std::string server_mock::encode_session_tracker ( const T &  tracker)

◆ encode_session_trackers()

std::string server_mock::encode_session_trackers ( const std::vector< session_tracker_field > &  trackers)

◆ process_erase()

static duk_int_t server_mock::process_erase ( duk_context *  ctx)
static

◆ process_get_keys()

static duk_int_t server_mock::process_get_keys ( duk_context *  ctx)
static

◆ process_get_shared()

static duk_int_t server_mock::process_get_shared ( duk_context *  ctx)
static

◆ process_set_shared()

static duk_int_t server_mock::process_set_shared ( duk_context *  ctx)
static

◆ type_byte()

template<class T >
constexpr uint8_t server_mock::type_byte ( )
constexpr