1#ifndef PROTOCOL_INCLUDED
2#define PROTOCOL_INCLUDED
226 virtual int shutdown(
bool server_shutdown =
false) = 0;
310 const char *message) = 0;
333 const char *sql_state) = 0;
357 uint param_count, ulong cond_count) = 0;
371 bool is_sql_prepare) = 0;
Dynamic parameters used as placeholders ('?') inside prepared statements.
Definition: item.h:4572
Definition: sql_list.h:434
Definition: protocol.h:33
bool store(uint32 from)
Definition: protocol.h:135
virtual bool flush()=0
Used for the classic protocol.
virtual bool store_field(const Field *field)=0
virtual bool store_ps_status(ulong stmt_id, uint column_count, uint param_count, ulong cond_count)=0
Sends prepared statement's id and metadata to the client after prepare.
virtual bool store_null()=0
virtual bool store_float(float from, uint32 decimals, uint32 zerofill)=0
virtual bool store_decimal(const my_decimal *, uint, uint)=0
virtual bool store_short(longlong from, uint32 zerofill)=0
virtual bool store_time(const MYSQL_TIME &time, uint precision)=0
virtual bool store_long(longlong from, uint32 zerofill)=0
bool store(longlong from)
Definition: protocol.h:136
virtual bool store_string(const char *from, size_t length, const CHARSET_INFO *fromcs)=0
virtual ~Protocol()=default
virtual bool store_datetime(const MYSQL_TIME &time, uint precision)=0
virtual bool end_result_metadata()=0
Signals the client that the metadata sending is done.
Protocol * pop_protocol()
Remove the reference to the previous protocol and return it.
Definition: protocol.h:56
bool store_long(longlong from)
Definition: protocol.h:142
bool store(ulonglong from)
Definition: protocol.h:137
virtual void abort_row()=0
virtual uint get_compression_level()=0
Returns compression level.
void push_protocol(Protocol *protocol)
Set reference to "this" as the previous protocol on the protocol provided as argument.
Definition: protocol.h:69
@ SEND_DEFAULTS
Definition: protocol.h:111
@ SEND_NUM_ROWS
Definition: protocol.h:111
@ SEND_EOF
Definition: protocol.h:111
virtual bool send_ok(uint server_status, uint statement_warn_count, ulonglong affected_rows, ulonglong last_insert_id, const char *message)=0
Send ok message to the client.
bool store_longlong(longlong from, bool unsigned_flag)
Definition: protocol.h:143
virtual char * get_compression_algorithm()=0
Returns compression algorithm name.
virtual int shutdown(bool server_shutdown=false)=0
Thread is being shut down, disconnect and free resources.
virtual int get_command(COM_DATA *com_data, enum_server_command *cmd)=0
Reads the command from the protocol and creates a command.
bool store_tiny(longlong from)
Definition: protocol.h:140
virtual void start_row()=0
Result set sending functions.
virtual bool send_error(uint sql_errno, const char *err_msg, const char *sql_state)=0
Send error message to the client.
bool store(String *str)
Definition: protocol.h:161
virtual bool get_compression()=0
Returns if the protocol is compressed or not.
Protocol * m_previous_protocol
Pointer to the Protocol below on the stack.
Definition: protocol.h:46
virtual int read_packet()=0
Read packet from client.
virtual uint get_rw_status()=0
Returns the read/writing status.
virtual bool store_double(double from, uint32 decimals, uint32 zerofill)=0
virtual enum enum_vio_type connection_type() const =0
virtual bool send_eof(uint server_status, uint statement_warn_count)=0
Send eof message to the client.
virtual bool start_result_metadata(uint num_cols, uint flags, const CHARSET_INFO *resultcs)=0
Prepares the server for metadata sending.
bool store(const char *from, const CHARSET_INFO *fromcs)
Send \0 end terminated string.
Definition: protocol.h:158
virtual bool connection_alive() const =0
Checks if the protocol's connection with the client is still alive.
virtual enum enum_protocol_type type() const =0
bool store(const LEX_STRING &s, const CHARSET_INFO *cs)
Definition: protocol.h:164
virtual bool send_field_metadata(Send_field *field, const CHARSET_INFO *charset)=0
Sends field metadata.
enum_protocol_type
Enum used by type() to specify the protocol type.
Definition: protocol.h:99
@ PROTOCOL_ERROR
Definition: protocol.h:104
@ PROTOCOL_PLUGIN
Definition: protocol.h:105
@ PROTOCOL_BINARY
Definition: protocol.h:102
@ PROTOCOL_LOCAL
Definition: protocol.h:103
@ PROTOCOL_TEXT
Definition: protocol.h:100
bool store_short(longlong from)
Definition: protocol.h:141
virtual bool send_parameters(List< Item_param > *parameters, bool is_sql_prepare)=0
Sends the OUT-parameters to the client.
virtual bool store_date(const MYSQL_TIME &time)=0
bool store(int from)
Definition: protocol.h:134
virtual bool store_tiny(longlong from, uint32 zerofill)=0
virtual bool has_client_capability(unsigned long client_capability)=0
Checks if the client capabilities include the one specified as parameter.
virtual bool store_longlong(longlong from, bool unsigned_flag, uint32 zerofill)=0
virtual void end_partial_result_set()=0
virtual ulong get_client_capabilities()=0
Returns the client capabilities stored on the protocol.
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
my_decimal class limits 'decimal_t' type to what we need in MySQL.
Definition: my_decimal.h:94
Definition of COM_DATA to be used with the Command service as data input structure.
static int flags[50]
Definition: hp_test1.cc:40
enum_server_command
A list of all MySQL protocol commands.
Definition: my_command.h:48
unsigned long long int ulonglong
Definition: my_inttypes.h:56
long long int longlong
Definition: my_inttypes.h:55
uint32_t uint32
Definition: my_inttypes.h:67
Common definition between mysql server & client.
Time declarations shared between the server and client API: you should not add anything to this heade...
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
constexpr value_type zerofill
Definition: classic_protocol_constants.h:274
const std::string charset("charset")
Definition: commit_order_queue.h:34
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
Our own string classes, used pervasively throughout the executor.
Definition: m_ctype.h:385
Definition: mysql_lex_string.h:35
char * str
Definition: mysql_lex_string.h:36
size_t length
Definition: mysql_lex_string.h:37
Definition: mysql_time.h:82
unsigned int uint
Definition: uca9-dump.cc:75
Definition: com_data.h:112
enum_vio_type
Definition: violite.h:79