24#ifndef MRS_COMPONENT_MYSQL_COMMAND_SERVICE_SESSION_H
25#define MRS_COMPONENT_MYSQL_COMMAND_SERVICE_SESSION_H
50 :
std::runtime_error(message), m_error_code(error_code) {}
52 [[nodiscard]]
unsigned int error_code()
const {
return m_error_code; }
68 void connect(
const std::string &user,
const std::string &
host,
69 bool initialize_thread,
unsigned long extra_client_flags = 0,
70 bool bypass_max_connections =
false);
73 void connect_authenticated(
const std::string &user,
75 unsigned long extra_client_flags = 0);
84 return mysql_h_ !=
nullptr;
87 [[nodiscard]]
unsigned int last_errno() const
noexcept;
89 [[nodiscard]]
std::
string last_sqlstate() const;
92 void connect_impl(const
std::
string &user, const
std::
string &
host,
93 bool initialize_thread,
unsigned long extra_client_flags,
94 bool bypass_max_connections,
98 bool thread_initialized_{
false};
Definition: mrs_component_mysql_command_service_session.h:47
unsigned int error_code() const
Definition: mrs_component_mysql_command_service_session.h:52
Connection_error(const std::string &message, unsigned int error_code)
Definition: mrs_component_mysql_command_service_session.h:49
unsigned int m_error_code
Definition: mrs_component_mysql_command_service_session.h:55
Owns the component command-service handle and optional thread initialization.
Definition: mrs_component_mysql_command_service_session.h:45
Mysql_command_service_session & operator=(const Mysql_command_service_session &)=delete
std::string host_
Definition: mrs_component_mysql_command_service_session.h:100
Mysql_command_service_session()=default
Mysql_command_service_session & operator=(Mysql_command_service_session &&)=delete
std::string user_
Definition: mrs_component_mysql_command_service_session.h:99
Mysql_command_service_session(const Mysql_command_service_session &)=delete
Mysql_command_service_session(Mysql_command_service_session &&)=delete
Null-terminated string which is securely wiped on destruction.
Definition: secure_string.h:59
This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient.
struct MYSQL_H_imp * MYSQL_H
Definition: mysql_command_services.h:33
static char * password
Definition: mysql_secure_installation.cc:58
const char * host
Definition: mysqladmin.cc:66
static MYSQL * mysql
Definition: mysqldump.cc:151
std::string HARNESS_EXPORT reset()
get 'reset attributes' ESC sequence.
Definition: vt100.cc:37
constexpr value_type autocommit
Definition: classic_protocol_constants.h:152
Definition: mrs_component.cc:137
void initialize_worker_command_thread()
Definition: mrs_component_mysql_command_service_session.cc:79
void deinitialize_worker_command_thread() noexcept
Definition: mrs_component_mysql_command_service_session.cc:81
noexcept
The return type for any call_and_catch(f, args...) call where f(args...) returns Type.
Definition: call_and_catch.h:76
Singleton class that stores the application type.
Definition: component_application_type_name.h:31
detail::SecureString< char, std::char_traits< char >, SecureAllocator< char > > SecureString
Definition: secure_string.h:402
stdx::expected< void, std::error_code > close(file_handle_type native_handle)
close file handle.
Definition: file.h:239
int last_error()
get last socket error.
Definition: socket_error.h:82
stdx::expected< void, error_type > connect(native_handle_type native_handle, const struct sockaddr *addr, size_t addr_len)
wrap connect() in a portable way.
Definition: socket.h:353
static int handle(int sql_errno, const char *sqlstate, const char *message, void *state)
Bridge function between the C++ API offered by this module and the C API of the parser service.
Definition: services.cc:64
Define std::hash<Gtid>.
Definition: gtid.h:355
mode
Definition: file_handle.h:61
static int is_connected(connection_descriptor *con)
Definition: node_connection.h:95