24#ifndef SQL_SERVICE_COMMAND_INCLUDE 
   25#define SQL_SERVICE_COMMAND_INCLUDE 
   33#define GR_PLUGIN_SESSION_THREAD_TIMEOUT 10 
   58                             void *session_id = 
nullptr);
 
   71                             void *variable_args = 
nullptr);
 
   84                              void *variable_args = 
nullptr);
 
   97                                          void *variable_args = 
nullptr);
 
  144      bool terminate = 
false);
 
  215                                   void *plugin_pointer = 
nullptr);
 
  231                             const char *
user, 
void *plugin_pointer = 
nullptr);
 
Definition: sql_service_command.h:105
 
void * m_plugin_pointer
Definition: sql_service_command.h:167
 
mysql_cond_t m_method_cond
Definition: sql_service_command.h:179
 
bool m_session_thread_terminate
Session termination flag.
Definition: sql_service_command.h:190
 
Synchronized_queue< st_session_method * > * incoming_methods
Definition: sql_service_command.h:165
 
bool m_method_execution_completed
Session thread method completion flag.
Definition: sql_service_command.h:184
 
mysql_cond_t m_run_cond
Definition: sql_service_command.h:176
 
void queue_new_method_for_application(long(Sql_service_commands::*method)(Sql_service_interface *, void *), bool terminate=false)
Method to submit a new method into execution on the session thread.
Definition: sql_service_command.cc:425
 
int terminate_session_thread()
Terminate the thread and close the session.
Definition: sql_service_command.cc:488
 
long wait_for_method_execution()
Wait for the queued method to return.
Definition: sql_service_command.cc:437
 
~Session_plugin_thread()
Definition: sql_service_command.cc:409
 
int session_thread_handler()
Thread handler for session creation.
Definition: sql_service_command.cc:532
 
long m_method_execution_return_value
The method return value.
Definition: sql_service_command.h:186
 
Sql_service_interface * get_service_interface()
Definition: sql_service_command.cc:605
 
const char * session_user
The user for the session connection.
Definition: sql_service_command.h:182
 
Sql_service_interface * m_server_interface
Definition: sql_service_command.h:163
 
mysql_mutex_t m_method_lock
Definition: sql_service_command.h:178
 
Sql_service_commands * command_interface
Definition: sql_service_command.h:161
 
my_thread_handle m_plugin_session_pthd
Session thread handle.
Definition: sql_service_command.h:173
 
Session_plugin_thread(Sql_service_commands *command_interface)
Definition: sql_service_command.cc:388
 
void set_return_pointer(void *pointer)
Sets a pointer that the next queued method will use to return a value.
Definition: sql_service_command.h:158
 
thread_state m_session_thread_state
Session thread state.
Definition: sql_service_command.h:188
 
int launch_session_thread(void *plugin_pointer_var, const char *user)
Launch a new thread that will create a new server session.
Definition: sql_service_command.cc:456
 
mysql_mutex_t m_run_lock
Definition: sql_service_command.h:175
 
int m_session_thread_error
Session thread error flag.
Definition: sql_service_command.h:192
 
void * return_object
The value for returning on methods.
Definition: sql_service_command.h:170
 
Definition: sql_service_command.h:195
 
Sql_service_commands sql_service_commands
Definition: sql_service_command.h:353
 
bool is_session_killed()
Was this session killed?
Definition: sql_service_command.cc:101
 
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 w...
Definition: sql_service_command.cc:158
 
int set_interface_user(const char *user)
Sets the SQL API user to be used on security checks.
Definition: sql_service_command.cc:128
 
Sql_service_command_interface()
Definition: sql_service_command.cc:34
 
Sql_service_interface * get_sql_service_interface()
Returns the SQL service interface associated to this class.
Definition: sql_service_command.cc:124
 
long execute_query(std::string &query)
Execute a query passed as parameter.
Definition: sql_service_command.cc:265
 
void terminate_connection_fields()
Stops and deletes all connection related structures.
Definition: sql_service_command.cc:109
 
Sql_service_interface * m_server_interface
The internal SQL session service interface to the server.
Definition: sql_service_command.h:356
 
Session_plugin_thread * m_plugin_session_thread
Definition: sql_service_command.h:359
 
bool is_session_valid()
Checks if there is an existing session.
Definition: sql_service_command.cc:97
 
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.
Definition: sql_service_command.cc:90
 
long execute_conditional_query(std::string &query, bool *result)
Execute a conditional query passed as parameter.
Definition: sql_service_command.cc:322
 
~Sql_service_command_interface()
Definition: sql_service_command.cc:39
 
int establish_session_connection(enum_plugin_con_isolation isolation_param, const char *user, void *plugin_pointer=nullptr)
Establishes the connection to the server.
Definition: sql_service_command.cc:43
 
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.
Definition: sql_service_command.cc:175
 
enum_plugin_con_isolation connection_thread_isolation
Definition: sql_service_command.h:351
 
Definition: sql_service_command.h:44
 
long internal_clone_server(Sql_service_interface *sql_interface, void *variable_args=nullptr)
Method to remotely clone a server.
Definition: sql_service_command.cc:199
 
long internal_execute_query(Sql_service_interface *sql_interface, void *variable_args=nullptr)
Method to execute a given query.
Definition: sql_service_command.cc:292
 
long internal_execute_conditional_query(Sql_service_interface *sql_interface, void *variable_args=nullptr)
Method to execute a given conditional query.
Definition: sql_service_command.cc:351
 
long internal_kill_session(Sql_service_interface *sql_interface, void *session_id=nullptr)
Method to kill the session identified by the given session id in those cases where the server hangs w...
Definition: sql_service_command.cc:132
 
Definition: sql_service_interface.h:34
 
Definition: plugin_utils.h:182
 
Some integer typedefs for easier portability.
 
static char * query
Definition: myisam_ftdump.cc:47
 
static char * password
Definition: mysql_secure_installation.cc:58
 
char * user
Definition: mysqladmin.cc:67
 
const char * host
Definition: mysqladmin.cc:66
 
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
 
enum_plugin_con_isolation
What is the policy when creation a new server session for SQL execution.
Definition: sql_service_command.h:38
 
@ PSESSION_DEDICATED_THREAD
Use a dedicated thread to open a session.
Definition: sql_service_command.h:41
 
@ PSESSION_INIT_THREAD
Use the current thread but initialize it.
Definition: sql_service_command.h:40
 
@ PSESSION_USE_THREAD
Use the current thread.
Definition: sql_service_command.h:39
 
Definition: my_thread_bits.h:58
 
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
 
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
 
Definition: sql_service_command.h:100
 
long(Sql_service_commands::* method)(Sql_service_interface *, void *)
Definition: sql_service_command.h:101
 
bool terminated
Definition: sql_service_command.h:102
 
Definition: plugin_utils.h:48