MySQL  8.0.27
Source Code Documentation
x_protocol_splicer.cc File Reference
#include "x_protocol_splicer.h"
#include <vector>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
#include <google/protobuf/message_lite.h>
#include "mysql/harness/logging/logging.h"
#include "mysql/harness/tls_error.h"
#include "mysqlx.pb.h"
#include "mysqlx_connection.pb.h"
#include "mysqlx_datatypes.pb.h"
#include "mysqlx_notice.pb.h"
#include "mysqlx_session.pb.h"

Functions

template<class T >
static std::string dump (const T &plain_buf)
 hexdump into a string. More...
 
static BasicSplicer::State log_fatal_error_code (const char *msg, std::error_code ec)
 log error-msg with error code and set the connection to its FINISH state. More...
 
template<class T >
uint8_t xproto_frame_msg_type ()
 
template<>
constexpr uint8_t xproto_frame_msg_type< Mysqlx::Error > ()
 
template<>
constexpr uint8_t xproto_frame_msg_type< Mysqlx::Ok > ()
 
template<>
constexpr uint8_t xproto_frame_msg_type< Mysqlx::Connection::Capabilities > ()
 
template<>
constexpr uint8_t xproto_frame_msg_type< Mysqlx::Connection::CapabilitiesSet > ()
 
template<>
constexpr uint8_t xproto_frame_msg_type< Mysqlx::Connection::CapabilitiesGet > ()
 
static size_t message_byte_size (const google::protobuf::MessageLite &msg)
 
template<class T >
static size_t xproto_frame_encode (const T &msg, std::vector< uint8_t > &out_buf)
 encode a message into a xproto frame. More...
 
static void set_capability_tls (Mysqlx::Connection::Capability *cap, bool value=true)
 
std::unique_ptr< google::protobuf::MessageLite > make_client_message (uint8_t message_type)
 
std::unique_ptr< google::protobuf::MessageLite > make_server_message (uint8_t message_type)
 

Function Documentation

◆ dump()

template<class T >
static std::string dump ( const T &  plain_buf)
static

hexdump into a string.

◆ log_fatal_error_code()

static BasicSplicer::State log_fatal_error_code ( const char *  msg,
std::error_code  ec 
)
static

log error-msg with error code and set the connection to its FINISH state.

◆ make_client_message()

std::unique_ptr<google::protobuf::MessageLite> make_client_message ( uint8_t  message_type)

◆ make_server_message()

std::unique_ptr<google::protobuf::MessageLite> make_server_message ( uint8_t  message_type)

◆ message_byte_size()

static size_t message_byte_size ( const google::protobuf::MessageLite &  msg)
static

◆ set_capability_tls()

static void set_capability_tls ( Mysqlx::Connection::Capability cap,
bool  value = true 
)
static

◆ xproto_frame_encode()

template<class T >
static size_t xproto_frame_encode ( const T &  msg,
std::vector< uint8_t > &  out_buf 
)
static

encode a message into a xproto frame.

  • 4-byte length (msg-type + payload)
  • 1-byte msg-type
  • payload

◆ xproto_frame_msg_type()

template<class T >
uint8_t xproto_frame_msg_type ( )

◆ xproto_frame_msg_type< Mysqlx::Connection::Capabilities >()

template<>
constexpr uint8_t xproto_frame_msg_type< Mysqlx::Connection::Capabilities > ( )
constexpr

◆ xproto_frame_msg_type< Mysqlx::Connection::CapabilitiesGet >()

template<>
constexpr uint8_t xproto_frame_msg_type< Mysqlx::Connection::CapabilitiesGet > ( )
constexpr

◆ xproto_frame_msg_type< Mysqlx::Connection::CapabilitiesSet >()

template<>
constexpr uint8_t xproto_frame_msg_type< Mysqlx::Connection::CapabilitiesSet > ( )
constexpr

◆ xproto_frame_msg_type< Mysqlx::Error >()

template<>
constexpr uint8_t xproto_frame_msg_type< Mysqlx::Error > ( )
constexpr

◆ xproto_frame_msg_type< Mysqlx::Ok >()

template<>
constexpr uint8_t xproto_frame_msg_type< Mysqlx::Ok > ( )
constexpr