26#ifndef MYSQLD_MOCK_X_MOCK_SESSION_INCLUDED
27#define MYSQLD_MOCK_X_MOCK_SESSION_INCLUDED
47 std::vector<uint8_t> &payload);
53 std::unique_ptr<xcl::XProtocol::Message>>,
61 void encode_ok(
const uint64_t affected_rows = 0,
62 const uint64_t last_insert_id = 0,
63 const uint16_t server_status = 0,
64 const uint16_t warning_count = 0)
override;
69 void encode_message(
const xcl::XProtocol::Server_message_type_id msg_id,
93 std::unique_ptr<StatementReaderBase> statement_processor,
TLS Context for the server side.
Definition: tls_server_context.h:46
Definition: x_mock_session.h:86
clock_type::time_point start_time_
Definition: x_mock_session.h:138
MySQLXProtocol protocol_
Definition: x_mock_session.h:134
std::vector< AsyncNotice > async_notices_
Definition: x_mock_session.h:133
clock_type::time_point notice_expiry() const
expiry of the notice.
Definition: x_mock_session.cc:148
net::steady_timer notice_timer_
Definition: x_mock_session.h:140
void greeting()
Definition: x_mock_session.cc:287
std::chrono::steady_clock clock_type
Definition: x_mock_session.h:88
void handshake()
Definition: x_mock_session.cc:297
void send_notice_then_notices()
Definition: x_mock_session.cc:556
void idle()
Definition: x_mock_session.cc:601
void send_response_then_handshake()
Definition: x_mock_session.cc:271
void notices()
Definition: x_mock_session.cc:577
void send_response_then_first_idle()
Definition: x_mock_session.cc:507
void terminate() override
Definition: x_mock_session.h:100
void cancel() override
Definition: x_mock_session.h:98
bool with_tls_
Definition: x_mock_session.h:136
MySQLServerMockSessionX(ProtocolBase::socket_type client_sock, ProtocolBase::endpoint_type client_ep, TlsServerContext &tls_server_ctx, std::unique_ptr< StatementReaderBase > statement_processor, const bool debug_mode, bool with_tls)
Definition: x_mock_session.cc:261
bool encode_due_async_notices(const clock_type::time_point &start_time)
encode all async notices.
Definition: x_mock_session.cc:162
void send_response_then_disconnect()
Definition: x_mock_session.cc:486
void run() override
Definition: x_mock_session.cc:713
void send_response_then_idle()
Definition: x_mock_session.cc:533
Definition: mock_session.h:35
bool debug_mode() const
Definition: mock_session.h:50
Definition: x_mock_session.h:42
stdx::expected< std::unique_ptr< xcl::XProtocol::Message >, std::string > gr_state_changed_from_json(const std::string &json_string)
Definition: x_mock_session.cc:186
void encode_resultset(const ResultsetResponse &response) override
Definition: x_mock_session.cc:731
void encode_message(const xcl::XProtocol::Server_message_type_id msg_id, const xcl::XProtocol::Message &msg)
Definition: x_mock_session.cc:118
XProtocolEncoder protocol_encoder_
Definition: x_mock_session.h:82
Mysqlx::Notice::Frame notice_frame
Definition: x_mock_session.h:74
XProtocolDecoder protocol_decoder_
Definition: x_mock_session.h:83
stdx::expected< size_t, std::error_code > decode_frame(std::vector< uint8_t > &payload)
Definition: x_mock_session.cc:66
void encode_async_notice(const AsyncNotice &async_notice)
Definition: x_mock_session.cc:241
stdx::expected< std::unique_ptr< xcl::XProtocol::Message >, std::string > get_notice_message(const unsigned id, const std::string &payload)
Definition: x_mock_session.cc:221
stdx::expected< std::tuple< uint8_t, size_t >, std::error_code > recv_header(const net::const_buffer &buf)
stdx::expected< std::pair< xcl::XProtocol::Client_message_type_id, std::unique_ptr< xcl::XProtocol::Message > >, std::error_code > decode_single_message(const std::vector< uint8_t > &payload)
Definition: x_mock_session.cc:97
void encode_ok(const uint64_t affected_rows=0, const uint64_t last_insert_id=0, const uint16_t server_status=0, const uint16_t warning_count=0) override
Definition: x_mock_session.cc:723
void encode_error(const ErrorResponse &msg) override
Definition: x_mock_session.cc:715
Definition: statement_reader.h:81
void terminate()
terminate the current connection.
Definition: protocol_base.cc:138
ProtocolBase(socket_type client_sock, endpoint_type client_ep, TlsServerContext &tls_ctx)
Definition: protocol_base.cc:36
void cancel()
Definition: protocol_base.cc:133
typename protocol_type::endpoint endpoint_type
Definition: statement_reader.h:85
typename protocol_type::socket socket_type
Definition: statement_reader.h:84
net::io_context & io_context()
Definition: statement_reader.h:338
Definition: x_protocol_decoder.h:37
Definition: x_protocol_encoder.h:38
Definition: buf0block_hint.cc:30
Message
Definition: histogram.h:83
Definition: mock_server_component.h:36
classic_protocol::message::server::Error ErrorResponse
Definition: statement_reader.h:70
Common frame for all notices.
Definition: mysqlx_notice.proto:71
Definition: statement_reader.h:72
Keeps result data for single SQL statement that returns resultset.
Definition: statement_reader.h:64