1#ifndef PROTOCOL_CLASSIC_INCLUDED
2#define PROTOCOL_CLASSIC_INCLUDED
78 const char *message)
override;
83 const char *sql_state)
override;
85 ulong cond_count)
override;
117 bool flush()
override;
159 int shutdown(
bool server_shutdown =
false)
override;
168 this->m_client_capabilities = client_capabilities;
203 bool on_full_packet =
false);
265 bool is_sql_prepare)
override;
Definition: sql_list.h:811
Dynamic parameters used as placeholders ('?') inside prepared statements.
Definition: item.h:4572
Definition: sql_list.h:434
Definition: protocol_classic.h:240
bool store_tiny(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3801
enum enum_protocol_type type() const override
Definition: protocol_classic.h:267
bool store_time(const MYSQL_TIME &time, uint precision) override
Definition: protocol_classic.cc:3939
bool store_double(double from, uint32 decimals, uint32 zerofill) override
Definition: protocol_classic.cc:3862
bool send_parameters(List< Item_param > *parameters, bool is_sql_prepare) override
Sends OUT-parameters by writing the values to the protocol.
Definition: protocol_classic.cc:3664
bool store_datetime(const MYSQL_TIME &time, uint precision) override
Definition: protocol_classic.cc:3875
bool store_date(const MYSQL_TIME &time) override
Definition: protocol_classic.cc:3919
bool store_long(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3823
bool store_longlong(longlong from, bool unsigned_flag, uint32 zerofill) override
Definition: protocol_classic.cc:3835
bool store_null() override
Definition: protocol_classic.cc:3791
bool store_float(float nr, uint32 decimals, uint32 zerofill) override
Definition: protocol_classic.cc:3849
void start_row() override
Result set sending functions.
Definition: protocol_classic.cc:3784
bool store_short(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3811
Protocol_binary(THD *thd_arg)
Definition: protocol_classic.h:246
uint bit_fields
Definition: protocol_classic.h:242
bool start_result_metadata(uint num_cols, uint flags, const CHARSET_INFO *resultcs) override
Prepares the server for metadata sending.
Definition: protocol_classic.cc:3776
Protocol_binary()=default
Definition: protocol_classic.h:52
uint get_rw_status() override
Returns the read/writing status.
Definition: protocol_classic.cc:3023
void set_vio(Vio *vio)
Definition: protocol_classic.cc:1398
int read_packet() override
Read packet from client.
Definition: protocol_classic.cc:1408
ulong input_packet_length
Definition: protocol_classic.h:72
bool parse_packet(union COM_DATA *data, enum_server_command cmd)
Definition: protocol_classic.cc:2832
bool flush() override
Used for the classic protocol.
Definition: protocol_classic.cc:3036
void claim_memory_ownership(bool claim)
Definition: protocol_classic.cc:1368
bool write(const uchar *ptr, size_t len)
Definition: protocol_classic.cc:1378
const CHARSET_INFO * result_cs
Definition: protocol_classic.h:74
NET * get_net()
Definition: protocol_classic.cc:1392
virtual void set_write_timeout(ulong write_timeout)
Definition: protocol_classic.cc:1359
enum enum_field_types * field_types
Definition: protocol_classic.h:67
bool start_result_metadata(uint num_cols, uint flags, const CHARSET_INFO *resultcs) override
Prepares the server for metadata sending.
Definition: protocol_classic.cc:3078
bool end_row() override
Definition: protocol_classic.cc:3361
bool connection_alive() const override
Checks if the protocol's connection with the client is still alive.
Definition: protocol_classic.cc:3395
ulong get_client_capabilities() override
Returns the client capabilities stored on the protocol.
Definition: protocol_classic.h:165
void set_client_capabilities(ulong client_capabilities)
Definition: protocol_classic.h:167
uchar * get_raw_packet()
Definition: protocol_classic.h:200
void wipe_net()
Definition: protocol_classic.cc:1384
uchar * input_raw_packet
Definition: protocol_classic.h:73
uchar get_error()
Definition: protocol_classic.cc:1382
String convert
Definition: protocol_classic.h:63
int get_command(COM_DATA *com_data, enum_server_command *cmd) override
Reads the command from the protocol and creates a command.
Definition: protocol_classic.cc:2989
bool send_field_metadata(Send_field *field, const CHARSET_INFO *item_charset) override
Sends a single column metadata.
Definition: protocol_classic.cc:3267
bool store_ps_status(ulong stmt_id, uint column_count, uint param_count, ulong cond_count) override
Sends prepared statement's id and metadata to the client after prepare.
Definition: protocol_classic.cc:3038
bool store_field(const Field *field) final
Definition: protocol_classic.cc:1284
enum enum_vio_type connection_type() const override
Returns the type of the connection.
Definition: protocol_classic.h:140
void add_client_capability(ulong client_capability)
Definition: protocol_classic.h:171
bool send_eof(uint server_status, uint statement_warn_count) override
A default implementation of "EOF" packet response to the client.
Definition: protocol_classic.cc:1315
Protocol_classic(THD *thd)
Definition: protocol_classic.h:91
bool get_compression() override
Returns if the protocol is compressed or not.
Definition: protocol_classic.cc:3060
Protocol_classic()
Definition: protocol_classic.h:89
void end_net()
Definition: protocol_classic.cc:1372
String * packet
Definition: protocol_classic.h:62
bool send_ok(uint server_status, uint statement_warn_count, ulonglong affected_rows, ulonglong last_insert_id, const char *message) override
A default implementation of "OK" packet response to the client.
Definition: protocol_classic.cc:1297
uint sending_flags
Definition: protocol_classic.h:71
void init(THD *thd_arg)
Definition: protocol_classic.cc:1276
Vio * get_vio()
Definition: protocol_classic.cc:1394
bool end_result_metadata() override
Signals the client that the metadata sending is done.
Definition: protocol_classic.cc:3123
bool init_net(Vio *vio)
Definition: protocol_classic.cc:1364
bool net_store_data_with_conversion(const uchar *from, size_t length, const CHARSET_INFO *fromcs, const CHARSET_INFO *tocs)
net_store_data() - extended version with character set conversion.
Definition: protocol_classic.cc:550
uint field_count
Definition: protocol_classic.h:70
my_socket get_socket()
Definition: protocol_classic.cc:3982
void remove_client_capability(unsigned long capability)
Definition: protocol_classic.h:175
bool create_command(COM_DATA *com_data, enum_server_command cmd, uchar *pkt, size_t length)
Parses the passed parameters and creates a command.
Definition: protocol_classic.cc:2980
bool send_error(uint sql_errno, const char *err_msg, const char *sql_state) override
A default implementation of "ERROR" packet response to the client.
Definition: protocol_classic.cc:1341
void set_result_character_set(const CHARSET_INFO *charset)
Sets the character set expected by the client.
Definition: protocol_classic.h:211
bool store_string(const char *from, size_t length, const CHARSET_INFO *cs) final
Definition: protocol_classic.cc:3421
ulong get_packet_length()
Definition: protocol_classic.h:198
void abort_row() override
Definition: protocol_classic.h:132
uint field_pos
Definition: protocol_classic.h:64
uint count
Definition: protocol_classic.h:68
String * get_output_packet()
Definition: protocol_classic.cc:1406
void set_output_pkt_nr(uint pkt_nr)
Definition: protocol_classic.cc:1400
bool has_client_capability(unsigned long client_capability) override
Checks if the client capabilities include the one specified as parameter.
Definition: protocol_classic.h:179
uint get_output_pkt_nr()
Definition: protocol_classic.cc:1404
int shutdown(bool server_shutdown=false) override
Thread is being shut down, disconnect and free resources.
Definition: protocol_classic.cc:3411
ulong m_client_capabilities
Definition: protocol_classic.h:54
virtual void set_read_timeout(ulong read_timeout, bool on_full_packet=false)
Definition: protocol_classic.cc:1351
uint get_compression_level() override
Returns compression level.
Definition: protocol_classic.cc:3070
void end_partial_result_set() override
Finish the result set with EOF packet, as is expected by the client, if there is an error evaluating ...
Definition: protocol_classic.cc:3031
THD * m_thd
Definition: protocol_classic.h:61
bool send_metadata
Definition: protocol_classic.h:65
char * get_compression_algorithm() override
Returns compression algorithm name.
Definition: protocol_classic.cc:3062
bool bad_packet
Definition: protocol_classic.h:88
void set_max_packet_size(ulong max_packet_size)
Definition: protocol_classic.cc:1388
Class used for the old (MySQL 4.0 protocol).
Definition: protocol_classic.h:218
bool store_null() override
Definition: protocol_classic.cc:3404
bool store_tiny(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3473
Protocol_text(THD *thd_arg)
Definition: protocol_classic.h:221
bool store_date(const MYSQL_TIME &time) override
Definition: protocol_classic.cc:3633
bool store_double(double from, uint32 decimals, uint32 zerofill) override
Definition: protocol_classic.cc:3591
bool store_long(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3490
bool store_longlong(longlong from, bool unsigned_flag, uint32 zerofill) override
Definition: protocol_classic.cc:3499
bool store_short(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3481
bool store_float(float nr, uint32 decimals, uint32 zerofill) override
Definition: protocol_classic.cc:3582
bool store_time(const MYSQL_TIME &time, uint precision) override
Definition: protocol_classic.cc:3642
bool send_parameters(List< Item_param > *parameters, bool) override
Sets OUT-parameters to user variables.
Definition: protocol_classic.cc:3730
bool store_decimal(const my_decimal *, uint, uint) final
Definition: protocol_classic.cc:3508
bool store_datetime(const MYSQL_TIME &time, uint precision) override
Definition: protocol_classic.cc:3621
enum enum_protocol_type type() const override
Definition: protocol_classic.h:237
void start_row() override
Result set sending functions.
Definition: protocol_classic.cc:3399
Definition: protocol.h:33
enum_protocol_type
Enum used by type() to specify the protocol type.
Definition: protocol.h:99
@ PROTOCOL_BINARY
Definition: protocol.h:102
@ PROTOCOL_TEXT
Definition: protocol.h:100
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Definition: sql_list.h:698
my_decimal class limits 'decimal_t' type to what we need in MySQL.
Definition: my_decimal.h:94
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
This file contains the field type.
enum_field_types
Column types for MySQL.
Definition: field_types.h:53
static int flags[50]
Definition: hp_test1.cc:40
A better implementation of the UNIX ctype(3) library.
enum_server_command
A list of all MySQL protocol commands.
Definition: my_command.h:48
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52
long long int longlong
Definition: my_inttypes.h:55
uint32_t uint32
Definition: my_inttypes.h:67
Common #defines and includes for file and socket I/O.
int my_socket
Definition: mysql.h:65
Common definition between mysql server & client.
Time declarations shared between the server and client API: you should not add anything to this heade...
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
static Value err()
Create a Value object that represents an error condition.
Definition: json_binary.cc:910
uchar * net_store_data(uchar *to, const uchar *from, size_t length)
Definition: protocol_classic.cc:1266
bool net_send_error(THD *thd, uint sql_errno, const char *err)
Send a error string to client.
Definition: protocol_classic.cc:613
bool store(Protocol *prot, I_List< i_string > *str_list)
Send a set of strings as one long string with ',' in between.
Definition: protocol_classic.cc:3371
Definition: m_ctype.h:385
Definition: mysql_time.h:82
Definition: mysql_com.h:913
Definition: violite.h:318
unsigned int uint
Definition: uca9-dump.cc:75
Definition: com_data.h:112
enum enum_vio_type vio_type(const MYSQL_VIO vio)
enum_vio_type
Definition: violite.h:79
@ NO_VIO_TYPE
Type of the connection is unknown.
Definition: violite.h:83