MySQL  8.0.18
Source Code Documentation
mysql_clone_protocol.h File Reference

Go to the source code of this file.

Functions

void mysql_clone_start_statement (THD *&thd, PSI_thread_key thread_key, PSI_statement_key statement_key) noexcept
 Start and set session and statement key form current thread. More...
 
void mysql_clone_finish_statement (THD *thd) noexcept
 Finish statement and session. More...
 
int mysql_clone_get_charsets (THD *thd, Mysql_Clone_Values &char_sets) noexcept
 Get all character set and collations. More...
 
int mysql_clone_validate_charsets (THD *thd, Mysql_Clone_Values &char_sets) noexcept
 Check if all characters sets are supported by server. More...
 
int mysql_clone_get_configs (THD *thd, Mysql_Clone_Key_Values &configs) noexcept
 Get system configuration parameter values. More...
 
int mysql_clone_validate_configs (THD *thd, Mysql_Clone_Key_Values &configs) noexcept
 Check if configuration parameter values match. More...
 
MYSQLmysql_clone_connect (THD *thd, const char *host, uint32_t port, const char *user, const char *passwd, mysql_clone_ssl_context *ssl_ctx, MYSQL_SOCKET *socket) noexcept
 Connect to a remote server and switch to clone protocol. More...
 
int mysql_clone_send_command (THD *thd, MYSQL *connection, bool set_active, uchar command, uchar *com_buffer, size_t buffer_length) noexcept
 Execute clone command on remote server. More...
 
int mysql_clone_get_response (THD *thd, MYSQL *connection, bool set_active, uint32_t timeout, uchar **packet, size_t *length, size_t *net_length) noexcept
 Get response from remote server. More...
 
int mysql_clone_kill (MYSQL *connection, MYSQL *kill_connection) noexcept
 Kill a remote connection. More...
 
void mysql_clone_disconnect (THD *thd, MYSQL *mysql, bool is_fatal, bool clear_error) noexcept
 Disconnect from a remote server. More...
 
void mysql_clone_get_error (THD *thd, uint32_t *err_num, const char **err_mesg) noexcept
 Get error number and message. More...
 
int mysql_clone_get_command (THD *thd, uchar *command, uchar **com_buffer, size_t *buffer_length) noexcept
 Get command from client. More...
 
int mysql_clone_send_response (THD *thd, bool secure, uchar *packet, size_t length) noexcept
 Send response to client. More...
 
int mysql_clone_send_error (THD *thd, uchar err_cmd, bool is_fatal) noexcept
 Send error to client. More...
 

Function Documentation

◆ mysql_clone_connect()

MYSQL* mysql_clone_connect ( THD thd,
const char *  host,
uint32_t  port,
const char *  user,
const char *  passwd,
mysql_clone_ssl_context ssl_ctx,
MYSQL_SOCKET socket 
)
noexcept

Connect to a remote server and switch to clone protocol.

Parameters
[in,out]thdserver session THD
[in]hosthost name to connect to
[in]portport number to connect to
[in]useruser name on remote host
[in]passwdpassword for the user
[in]ssl_ctxclient ssl context
[out]socketNetwork socket for the connection
Returns
Connection object if successful.

◆ mysql_clone_disconnect()

void mysql_clone_disconnect ( THD thd,
MYSQL mysql,
bool  is_fatal,
bool  clear_error 
)
noexcept

Disconnect from a remote server.

Parameters
[in,out]thdlocal session THD
[in,out]mysqlconnection object
[in]is_fatalif closing after fatal error
[in]clear_errorclear any earlier error in session

◆ mysql_clone_finish_statement()

void mysql_clone_finish_statement ( THD thd)
noexcept

Finish statement and session.

Parameters
[in,out]thdserver session THD

◆ mysql_clone_get_charsets()

int mysql_clone_get_charsets ( THD thd,
Mysql_Clone_Values char_sets 
)
noexcept

Get all character set and collations.

Parameters
[in,out]thdserver session THD
[out]char_setsall character set collations
Returns
error code.

◆ mysql_clone_get_command()

int mysql_clone_get_command ( THD thd,
uchar command,
uchar **  com_buffer,
size_t *  buffer_length 
)
noexcept

Get command from client.

Parameters
[in,out]thdserver session THD
[out]commandremote command
[out]com_bufferdata following command
[out]buffer_lengthdata length
Returns
error code.

◆ mysql_clone_get_configs()

int mysql_clone_get_configs ( THD thd,
Mysql_Clone_Key_Values configs 
)
noexcept

Get system configuration parameter values.

Parameters
[in,out]thdserver session THD
[in,out]configsa list of configuration key value pair keys are input and values are output
Returns
error code.

◆ mysql_clone_get_error()

void mysql_clone_get_error ( THD thd,
uint32_t *  err_num,
const char **  err_mesg 
)
noexcept

Get error number and message.

Parameters
[in,out]thdlocal session THD
[out]err_numerror number
[out]err_mesgerror message text

◆ mysql_clone_get_response()

int mysql_clone_get_response ( THD thd,
MYSQL connection,
bool  set_active,
uint32_t  timeout,
uchar **  packet,
size_t *  length,
size_t *  net_length 
)
noexcept

Get response from remote server.

Parameters
[in,out]thdlocal session THD
[in,out]connectionconnection object
[in]set_activeset socket active for current THD
[in]timeouttimeout in seconds
[out]packetresponse packet
[out]lengthpacket length
[out]net_lengthnetwork data length for compressed data
Returns
error code.

◆ mysql_clone_kill()

int mysql_clone_kill ( MYSQL connection,
MYSQL kill_connection 
)
noexcept

Kill a remote connection.

Parameters
[in,out]connectionconnection object
[in]kill_connectionconnection to kill
Returns
error code.

◆ mysql_clone_send_command()

int mysql_clone_send_command ( THD thd,
MYSQL connection,
bool  set_active,
uchar  command,
uchar com_buffer,
size_t  buffer_length 
)
noexcept

Execute clone command on remote server.

Parameters
[in,out]thdlocal session THD
[in,out]connectionconnection object
[in]set_activeset socket active for current THD
[in]commandremote command
[in]com_bufferdata following command
[in]buffer_lengthdata length
Returns
error code.

◆ mysql_clone_send_error()

int mysql_clone_send_error ( THD thd,
uchar  err_cmd,
bool  is_fatal 
)
noexcept

Send error to client.

Parameters
[in,out]thdserver session THD
[in]err_cmderror response command
[in]is_fatalif fatal error
Returns
error code.

◆ mysql_clone_send_response()

int mysql_clone_send_response ( THD thd,
bool  secure,
uchar packet,
size_t  length 
)
noexcept

Send response to client.

Parameters
[in,out]thdserver session THD
[in]secureneeds to be sent over secure connection
[in]packetresponse packet
[in]lengthpacket length
Returns
error code.

◆ mysql_clone_start_statement()

void mysql_clone_start_statement ( THD *&  thd,
PSI_thread_key  thread_key,
PSI_statement_key  statement_key 
)
noexcept

Start and set session and statement key form current thread.

Parameters
[in,out]thdserver session THD
[in]thread_keyPSI key for thread
[in]statement_keyPSI Key for statement

◆ mysql_clone_validate_charsets()

int mysql_clone_validate_charsets ( THD thd,
Mysql_Clone_Values char_sets 
)
noexcept

Check if all characters sets are supported by server.

Parameters
[in,out]thdserver session THD
[in]char_setsall character set collations to validate
Returns
error code.

◆ mysql_clone_validate_configs()

int mysql_clone_validate_configs ( THD thd,
Mysql_Clone_Key_Values configs 
)
noexcept

Check if configuration parameter values match.

Parameters
[in,out]thdserver session THD
[in]configsa list of configuration key value pair
Returns
error code.