MySQL  8.0.15
Source Code Documentation
Protocol_text Class Reference

Class used for the old (MySQL 4.0 protocol). More...

#include <protocol_classic.h>

Inheritance diagram for Protocol_text:
Protocol_classic Protocol Protocol_binary

Public Member Functions

 Protocol_text ()
 
 Protocol_text (THD *thd_arg)
 
virtual bool store_null ()
 
virtual bool store_tiny (longlong from)
 
virtual bool store_short (longlong from)
 
virtual bool store_long (longlong from)
 
virtual bool store_longlong (longlong from, bool unsigned_flag)
 
virtual bool store_decimal (const my_decimal *, uint, uint)
 
virtual bool store (const char *from, size_t length, const CHARSET_INFO *cs)
 
virtual bool store (float nr, uint32 decimals, String *buffer)
 
virtual bool store (double from, uint32 decimals, String *buffer)
 
virtual bool store (MYSQL_TIME *time, uint precision)
 
virtual bool store_date (MYSQL_TIME *time)
 
virtual bool store_time (MYSQL_TIME *time, uint precision)
 
virtual bool store (Proto_field *field)
 
virtual void start_row ()
 Result set sending functions. More...
 
virtual bool send_parameters (List< Item_param > *parameters, bool)
 Sets OUT-parameters to user variables. More...
 
virtual enum enum_protocol_type type ()
 
- Public Member Functions inherited from Protocol_classic
 Protocol_classic ()
 
 Protocol_classic (THD *thd)
 
virtual ~Protocol_classic ()
 
void init (THD *thd_arg)
 
virtual int read_packet ()
 Read packet from client. More...
 
virtual int get_command (COM_DATA *com_data, enum_server_command *cmd)
 Reads the command from the protocol and creates a command. More...
 
virtual bool create_command (COM_DATA *com_data, enum_server_command cmd, uchar *pkt, size_t length)
 Parses the passed parameters and creates a command. More...
 
virtual bool flush ()
 Used for the classic protocol. More...
 
virtual void end_partial_result_set ()
 Finish the result set with EOF packet, as is expected by the client, if there is an error evaluating the next row and a continue handler for the error. More...
 
virtual bool end_row ()
 
virtual uint get_rw_status ()
 Returns the read/writing status. More...
 
virtual bool get_compression ()
 Returns if the protocol is compressed or not. More...
 
virtual bool start_result_metadata (uint num_cols, uint flags, const CHARSET_INFO *resultcs)
 Prepares the server for metadata sending. More...
 
virtual bool end_result_metadata ()
 Signals the client that the metadata sending is done. More...
 
virtual bool send_field_metadata (Send_field *field, const CHARSET_INFO *item_charset)
 Sends a single column metadata. More...
 
virtual void abort_row ()
 
virtual enum enum_vio_type connection_type ()
 Returns the type of the connection. More...
 
virtual my_socket get_socket ()
 
bool init_net (Vio *vio)
 
void claim_memory_ownership ()
 
void end_net ()
 
bool write (const uchar *ptr, size_t len)
 
uchar get_error ()
 
void set_max_packet_size (ulong max_packet_size)
 
virtual int shutdown (bool server_shutdown=false)
 Thread is being shut down, disconnect and free resources. More...
 
void wipe_net ()
 
virtual bool connection_alive ()
 Checks if the protocol's connection with the client is still alive. More...
 
virtual ulong get_client_capabilities ()
 Returns the client capabilities stored on the protocol. More...
 
void set_client_capabilities (ulong client_capabilities)
 
void add_client_capability (ulong client_capability)
 
void remove_client_capability (unsigned long capability)
 
virtual bool has_client_capability (unsigned long client_capability)
 Checks if the client capabilities include the one specified as parameter. More...
 
NETget_net ()
 
Vioget_vio ()
 
void set_vio (Vio *vio)
 
void set_output_pkt_nr (uint pkt_nr)
 
uint get_output_pkt_nr ()
 
Stringget_output_packet ()
 
uint get_packet_length ()
 
ucharget_raw_packet ()
 
virtual void set_read_timeout (ulong read_timeout)
 
virtual void set_write_timeout (ulong write_timeout)
 
- Public Member Functions inherited from Protocol
virtual ~Protocol ()
 
Protocolpop_protocol ()
 Remove the reference to the previous protocol and return it. More...
 
void push_protocol (Protocol *protocol)
 Set reference to "this" as the previous protocol on the protocol provided as argument. More...
 
bool store (int from)
 
bool store (uint32 from)
 
bool store (longlong from)
 
bool store (ulonglong from)
 
bool store (const char *from, const CHARSET_INFO *fromcs)
 Send \0 end terminated string. More...
 
bool store (String *str)
 
bool store (const LEX_STRING &s, const CHARSET_INFO *cs)
 

Protected Member Functions

virtual bool store (const char *from, size_t length, const CHARSET_INFO *fromcs, const CHARSET_INFO *tocs)
 
- Protected Member Functions inherited from Protocol_classic
bool net_store_data (const uchar *from, size_t length)
 
virtual bool net_store_data (const uchar *from, size_t length, const CHARSET_INFO *fromcs, const CHARSET_INFO *tocs)
 net_store_data() - extended version with character set conversion. More...
 
bool store_string_aux (const char *from, size_t length, const CHARSET_INFO *fromcs, const CHARSET_INFO *tocs)
 Auxilary function to convert string to the given character set and store in network buffer. More...
 
virtual bool send_ok (uint server_status, uint statement_warn_count, ulonglong affected_rows, ulonglong last_insert_id, const char *message)
 A default implementation of "OK" packet response to the client. More...
 
virtual bool send_eof (uint server_status, uint statement_warn_count)
 A default implementation of "EOF" packet response to the client. More...
 
virtual bool send_error (uint sql_errno, const char *err_msg, const char *sql_state)
 A default implementation of "ERROR" packet response to the client. More...
 
virtual bool store_ps_status (ulong stmt_id, uint column_count, uint param_count, ulong cond_count)
 Sends prepared statement's id and metadata to the client after prepare. More...
 

Additional Inherited Members

- Public Types inherited from Protocol
enum  enum_protocol_type {
  PROTOCOL_TEXT = 0, PROTOCOL_BINARY = 1, PROTOCOL_LOCAL = 2, PROTOCOL_ERROR = 3,
  PROTOCOL_PLUGIN = 4
}
 Enum used by type() to specify the protocol type. More...
 
enum  { SEND_NUM_ROWS = 1, SEND_DEFAULTS = 2, SEND_EOF = 4 }
 Flags available to alter the way the messages are sent to the client. More...
 
using Type = BaseProtocol::Type
 
- Static Public Member Functions inherited from Protocol
static Type get_default ()
 
static Type get_by_name (const std::string &name)
 Returns type of the protocol by its name. More...
 
static BaseProtocolcreate (Type type, routing::RoutingSockOpsInterface *routing_sock_ops)
 Factory method creating protocol object for handling the routing code that is protocol-specific. More...
 
static uint16_t get_default_port (Type type)
 Returns default port for the selected protocol. More...
 
- Public Attributes inherited from Protocol_classic
bool bad_packet
 
- Protected Attributes inherited from Protocol_classic
MYSQL_THD m_thd
 
Stringpacket
 
Stringconvert
 
uint field_pos
 
bool send_metadata
 
enum enum_field_typesfield_types
 
uint count
 
uint field_count
 
uint sending_flags
 
ulong input_packet_length
 
ucharinput_raw_packet
 
CHARSET_INFOresult_cs
 

Detailed Description

Class used for the old (MySQL 4.0 protocol).

Constructor & Destructor Documentation

◆ Protocol_text() [1/2]

Protocol_text::Protocol_text ( )
inline

◆ Protocol_text() [2/2]

Protocol_text::Protocol_text ( THD thd_arg)
inline

Member Function Documentation

◆ send_parameters()

bool Protocol_text::send_parameters ( List< Item_param > *  parameters,
bool   
)
virtual

Sets OUT-parameters to user variables.

Parameters
parametersList of PS/SP parameters (both input and output).
Returns
Error status.
Return values
falseSuccess.
trueError.

Implements Protocol.

Reimplemented in Protocol_binary.

◆ start_row()

void Protocol_text::start_row ( )
virtual

Result set sending functions.

Server uses following schema to send result: ... sending metadata ... | start_result_metadata(...) | start_row() | send_field_metadata(...) | end_row() ... same for each field sent ... | end_result_metadata(...) | ... sending result ... | start_row(...) | store_xxx(...) ... store_xxx(..) is called for each field ... | end_row(...) ... same for each row, until all rows are sent ... | send_ok/eof/error(...) However, a protocol implementation might use different schema. For example, Protocol_callback ignores start/end_row when metadata is being sent.

Implements Protocol_classic.

Reimplemented in Protocol_binary.

◆ store() [1/6]

virtual bool Protocol_text::store ( const char *  from,
size_t  length,
const CHARSET_INFO cs 
)
inlinevirtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store() [2/6]

bool Protocol_text::store ( float  nr,
uint32  decimals,
String buffer 
)
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store() [3/6]

bool Protocol_text::store ( double  from,
uint32  decimals,
String buffer 
)
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store() [4/6]

bool Protocol_text::store ( MYSQL_TIME tm,
uint  decimals 
)
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store() [5/6]

bool Protocol_text::store ( Proto_field field)
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store() [6/6]

bool Protocol_text::store ( const char *  from,
size_t  length,
const CHARSET_INFO fromcs,
const CHARSET_INFO tocs 
)
protectedvirtual

Reimplemented in Protocol_binary.

◆ store_date()

bool Protocol_text::store_date ( MYSQL_TIME time)
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store_decimal()

bool Protocol_text::store_decimal ( const my_decimal d,
uint  prec,
uint  dec 
)
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store_long()

bool Protocol_text::store_long ( longlong  from)
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store_longlong()

bool Protocol_text::store_longlong ( longlong  from,
bool  unsigned_flag 
)
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store_null()

bool Protocol_text::store_null ( )
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store_short()

bool Protocol_text::store_short ( longlong  from)
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store_time()

bool Protocol_text::store_time ( MYSQL_TIME time,
uint  precision 
)
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ store_tiny()

bool Protocol_text::store_tiny ( longlong  from)
virtual

Implements Protocol.

Reimplemented in Protocol_binary.

◆ type()

virtual enum enum_protocol_type Protocol_text::type ( )
inlinevirtual

Implements Protocol_classic.

Reimplemented in Protocol_binary.


The documentation for this class was generated from the following files: