MySQL 8.4.2
Source Code Documentation
Sql_service_command_interface Class Reference

#include <sql_service_command.h>

Public Member Functions

 Sql_service_command_interface ()
 
 ~Sql_service_command_interface ()
 
int establish_session_connection (enum_plugin_con_isolation isolation_param, const char *user, void *plugin_pointer=nullptr)
 Establishes the connection to the server. More...
 
int reestablish_connection (enum_plugin_con_isolation isolation_param, const char *user, void *plugin_pointer=nullptr)
 Terminates the old connection and creates a new one to the server. More...
 
bool is_session_killed ()
 Was this session killed? More...
 
void terminate_connection_fields ()
 Stops and deletes all connection related structures. More...
 
Sql_service_interfaceget_sql_service_interface ()
 Returns the SQL service interface associated to this class. More...
 
int set_interface_user (const char *user)
 Sets the SQL API user to be used on security checks. More...
 
long kill_session (unsigned long session_id)
 Method to kill the session identified by the given session id in those cases where the server hangs while executing the sql query. More...
 
bool is_session_valid ()
 Checks if there is an existing session. More...
 
long clone_server (std::string &host, std::string &port, std::string &username, std::string &password, bool use_ssl, std::string &error)
 Method to remotely clone a server. More...
 
long execute_query (std::string &query)
 Execute a query passed as parameter. More...
 
long execute_query (std::string &query, std::string &error)
 Execute a query passed as parameter. More...
 
long execute_conditional_query (std::string &query, bool *result)
 Execute a conditional query passed as parameter. More...
 
long execute_conditional_query (std::string &query, bool *result, std::string &error)
 Execute a conditional query passed as parameter. More...
 

Private Attributes

enum_plugin_con_isolation connection_thread_isolation
 
Sql_service_commands sql_service_commands
 
Sql_service_interfacem_server_interface
 The internal SQL session service interface to the server. More...
 
Session_plugin_threadm_plugin_session_thread
 

Constructor & Destructor Documentation

◆ Sql_service_command_interface()

Sql_service_command_interface::Sql_service_command_interface ( )

◆ ~Sql_service_command_interface()

Sql_service_command_interface::~Sql_service_command_interface ( )

Member Function Documentation

◆ clone_server()

long Sql_service_command_interface::clone_server ( std::string &  host,
std::string &  port,
std::string &  username,
std::string &  password,
bool  use_ssl,
std::string &  error 
)

Method to remotely clone a server.

Parameters
[in]hostThe host to clone
[in]portThe host port
[in]usernameThe username to authenticate in the remote server
[in]passwordThe password to authenticate in the remote server
[in]use_sslIs ssl configured for the clone process
[out]errorThe error message in case of error
Returns
the error value returned
Return values
0OK
!=0Error on execution

◆ establish_session_connection()

int Sql_service_command_interface::establish_session_connection ( enum_plugin_con_isolation  isolation_param,
const char *  user,
void *  plugin_pointer = nullptr 
)

Establishes the connection to the server.

Parameters
isolation_paramsession creation requirements: use current thread, use thread but initialize it or create it in a dedicated thread
userthe user for the connection
plugin_pointerthe plugin pointer for threaded connections
Returns
the connection was successful
Return values
0OK
!=0Error

◆ execute_conditional_query() [1/2]

long Sql_service_command_interface::execute_conditional_query ( std::string &  query,
bool *  result 
)

Execute a conditional query passed as parameter.

Parameters
[in]queryThe query to execute
[in]resultThe result of the query
Returns
the error value returned
Return values
0OK
!=0Error on execution

◆ execute_conditional_query() [2/2]

long Sql_service_command_interface::execute_conditional_query ( std::string &  query,
bool *  result,
std::string &  error 
)

Execute a conditional query passed as parameter.

Parameters
[in]queryThe query to execute
[in]resultThe result of the query
[out]errorThe error message in case of error
Returns
the error value returned
Return values
0OK
!=0Error on execution

◆ execute_query() [1/2]

long Sql_service_command_interface::execute_query ( std::string &  query)

Execute a query passed as parameter.

Parameters
[in]queryThe query to execute
Returns
the error value returned
Return values
0OK
!=0Error on execution

◆ execute_query() [2/2]

long Sql_service_command_interface::execute_query ( std::string &  query,
std::string &  error 
)

Execute a query passed as parameter.

Parameters
[in]queryThe query to execute
[out]errorThe error message in case of error
Returns
the error value returned
Return values
0OK
!=0Error on execution

◆ get_sql_service_interface()

Sql_service_interface * Sql_service_command_interface::get_sql_service_interface ( )

Returns the SQL service interface associated to this class.

Returns
the sql service interface field

◆ is_session_killed()

bool Sql_service_command_interface::is_session_killed ( )

Was this session killed?

Return values
truesession was killed
falsesession was not killed

◆ is_session_valid()

bool Sql_service_command_interface::is_session_valid ( )

Checks if there is an existing session.

Returns
the error value returned
Return values
truevalid
falsesome issue prob happened on connection

◆ kill_session()

long Sql_service_command_interface::kill_session ( unsigned long  session_id)

Method to kill the session identified by the given session id in those cases where the server hangs while executing the sql query.

Parameters
session_idid of the session to be killed.
Returns
the error value returned
Return values
0- success
>0- Failure

◆ reestablish_connection()

int Sql_service_command_interface::reestablish_connection ( enum_plugin_con_isolation  isolation_param,
const char *  user,
void *  plugin_pointer = nullptr 
)

Terminates the old connection and creates a new one to the server.

Parameters
isolation_paramsession creation requirements: use current thread, use thread but initialize it or create it in a dedicated thread
userthe user for the connection
plugin_pointerthe plugin pointer for threaded connections
Returns
the connection was successful
Return values
0OK
!=0Error

◆ set_interface_user()

int Sql_service_command_interface::set_interface_user ( const char *  user)

Sets the SQL API user to be used on security checks.

Parameters
userthe user to be used
Returns
the operation was successful
Return values
0OK
!=0Error

◆ terminate_connection_fields()

void Sql_service_command_interface::terminate_connection_fields ( )

Stops and deletes all connection related structures.

Member Data Documentation

◆ connection_thread_isolation

enum_plugin_con_isolation Sql_service_command_interface::connection_thread_isolation
private

◆ m_plugin_session_thread

Session_plugin_thread* Sql_service_command_interface::m_plugin_session_thread
private

◆ m_server_interface

Sql_service_interface* Sql_service_command_interface::m_server_interface
private

The internal SQL session service interface to the server.

◆ sql_service_commands

Sql_service_commands Sql_service_command_interface::sql_service_commands
private

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