1#ifndef PROTOCOL_CLASSIC_INCLUDED
2#define PROTOCOL_CLASSIC_INCLUDED
78 bool send_ok(uint server_status, uint statement_warn_count,
80 const char *message)
override;
82 bool send_eof(uint server_status, uint statement_warn_count)
override;
84 bool send_error(uint sql_errno,
const char *err_msg,
85 const char *sql_state)
override;
86 bool store_ps_status(ulong stmt_id, uint column_count, uint param_count,
87 ulong cond_count)
override;
119 bool flush()
override;
161 int shutdown(
bool server_shutdown =
false)
override;
170 this->m_client_capabilities = client_capabilities;
205 bool on_full_packet =
false);
267 bool is_sql_prepare)
override;
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Definition: sql_list.h:871
Dynamic parameters used as placeholders ('?') inside prepared statements.
Definition: item.h:4789
Definition: sql_list.h:494
Definition: protocol_classic.h:242
bool store_tiny(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3701
enum enum_protocol_type type() const override
Definition: protocol_classic.h:269
bool store_time(const MYSQL_TIME &time, uint precision) override
Definition: protocol_classic.cc:3839
bool store_double(double from, uint32 decimals, uint32 zerofill) override
Definition: protocol_classic.cc:3762
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:3563
bool store_datetime(const MYSQL_TIME &time, uint precision) override
Definition: protocol_classic.cc:3775
bool store_date(const MYSQL_TIME &time) override
Definition: protocol_classic.cc:3819
bool store_long(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3723
bool store_longlong(longlong from, bool unsigned_flag, uint32 zerofill) override
Definition: protocol_classic.cc:3735
bool store_null() override
Definition: protocol_classic.cc:3690
bool store_float(float nr, uint32 decimals, uint32 zerofill) override
Definition: protocol_classic.cc:3749
void start_row() override
Result set sending functions.
Definition: protocol_classic.cc:3683
bool store_short(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3711
Protocol_binary(THD *thd_arg)
Definition: protocol_classic.h:248
uint bit_fields
Definition: protocol_classic.h:244
bool start_result_metadata(uint num_cols, uint flags, const CHARSET_INFO *resultcs) override
Prepares the server for metadata sending.
Definition: protocol_classic.cc:3675
Protocol_binary()=default
Definition: protocol_classic.h:54
uint get_rw_status() override
Returns the read/writing status.
Definition: protocol_classic.cc:2921
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:74
bool parse_packet(union COM_DATA *data, enum_server_command cmd)
Definition: protocol_classic.cc:2742
bool flush() override
Used for the classic protocol.
Definition: protocol_classic.cc:2934
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:76
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:69
bool start_result_metadata(uint num_cols, uint flags, const CHARSET_INFO *resultcs) override
Prepares the server for metadata sending.
Definition: protocol_classic.cc:2976
bool end_row() override
Definition: protocol_classic.cc:3259
bool connection_alive() const override
Checks if the protocol's connection with the client is still alive.
Definition: protocol_classic.cc:3293
ulong get_client_capabilities() override
Returns the client capabilities stored on the protocol.
Definition: protocol_classic.h:167
void set_client_capabilities(ulong client_capabilities)
Definition: protocol_classic.h:169
uchar * get_raw_packet()
Definition: protocol_classic.h:202
void wipe_net()
Definition: protocol_classic.cc:1384
uchar * input_raw_packet
Definition: protocol_classic.h:75
uchar get_error()
Definition: protocol_classic.cc:1382
String convert
Definition: protocol_classic.h:65
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:2887
bool send_field_metadata(Send_field *field, const CHARSET_INFO *item_charset) override
Sends a single column metadata.
Definition: protocol_classic.cc:3165
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:2936
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:142
void add_client_capability(ulong client_capability)
Definition: protocol_classic.h:173
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:93
bool get_compression() override
Returns if the protocol is compressed or not.
Definition: protocol_classic.cc:2958
Protocol_classic()
Definition: protocol_classic.h:91
void end_net()
Definition: protocol_classic.cc:1372
String * packet
Definition: protocol_classic.h:64
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:73
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:3021
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:72
my_socket get_socket()
Definition: protocol_classic.cc:3882
void remove_client_capability(unsigned long capability)
Definition: protocol_classic.h:177
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:2878
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:213
bool store_string(const char *from, size_t length, const CHARSET_INFO *cs) final
Definition: protocol_classic.cc:3319
ulong get_packet_length()
Definition: protocol_classic.h:200
void abort_row() override
Definition: protocol_classic.h:134
uint field_pos
Definition: protocol_classic.h:66
uint count
Definition: protocol_classic.h:70
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:181
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:3309
ulong m_client_capabilities
Definition: protocol_classic.h:56
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:2968
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:2929
THD * m_thd
Definition: protocol_classic.h:63
bool send_metadata
Definition: protocol_classic.h:67
char * get_compression_algorithm() override
Returns compression algorithm name.
Definition: protocol_classic.cc:2960
bool bad_packet
Definition: protocol_classic.h:90
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:220
bool store_null() override
Definition: protocol_classic.cc:3302
bool store_tiny(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3372
Protocol_text(THD *thd_arg)
Definition: protocol_classic.h:223
bool store_date(const MYSQL_TIME &time) override
Definition: protocol_classic.cc:3532
bool store_double(double from, uint32 decimals, uint32 zerofill) override
Definition: protocol_classic.cc:3490
bool store_long(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3389
bool store_longlong(longlong from, bool unsigned_flag, uint32 zerofill) override
Definition: protocol_classic.cc:3398
bool store_short(longlong from, uint32 zerofill) override
Definition: protocol_classic.cc:3380
bool store_float(float nr, uint32 decimals, uint32 zerofill) override
Definition: protocol_classic.cc:3481
bool store_time(const MYSQL_TIME &time, uint precision) override
Definition: protocol_classic.cc:3541
bool send_parameters(List< Item_param > *parameters, bool) override
Sets OUT-parameters to user variables.
Definition: protocol_classic.cc:3629
bool store_decimal(const my_decimal *, uint, uint) final
Definition: protocol_classic.cc:3407
bool store_datetime(const MYSQL_TIME &time, uint precision) override
Definition: protocol_classic.cc:3520
enum enum_protocol_type type() const override
Definition: protocol_classic.h:239
void start_row() override
Result set sending functions.
Definition: protocol_classic.cc:3297
Definition: protocol.h:33
enum_protocol_type
Enum used by type() to specify the protocol type.
Definition: protocol.h:101
@ PROTOCOL_BINARY
Definition: protocol.h:104
@ PROTOCOL_TEXT
Definition: protocol.h:102
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: sql_list.h:758
my_decimal class limits 'decimal_t' type to what we need in MySQL.
Definition: my_decimal.h:96
This file contains the field type.
enum_field_types
Column types for MySQL Note: Keep include/mysql/components/services/bits/stored_program_bits....
Definition: field_types.h:55
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
Header for compiler-dependent features.
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:908
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:3269
Definition: m_ctype.h:421
Definition: mysql_time.h:82
Definition: mysql_com.h:914
Definition: violite.h:320
Definition: com_data.h:104
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