23#ifndef GCS_MYSQL_NETWORK_PROVIDER_INCLUDED
24#define GCS_MYSQL_NETWORK_PROVIDER_INCLUDED
109 const char *
user,
const char *passwd,
110 const char *db,
unsigned int port,
111 const char *unix_socket,
112 unsigned long clientflag) = 0;
126 const unsigned char *arg,
size_t length,
127 bool skip_check) = 0;
189 const void *arg) = 0;
205 const char *ca,
const char *capath,
206 const char *cipher) = 0;
228 const char *passwd,
const char *db,
229 unsigned int port,
const char *unix_socket,
230 unsigned long clientflag)
override;
236 const unsigned char *arg,
size_t length,
237 bool skip_check)
override;
280 const void *arg)
override;
287 const char *ca,
const char *capath,
288 const char *cipher)
override;
365 [
this](
const auto &client_connection) {
366 m_native_interface->mysql_close(client_connection.second);
367 m_native_interface->mysql_free(client_connection.second);
377 std::pair<bool, int>
start()
override;
382 std::pair<bool, int>
stop()
override;
412 const std::string &address,
const unsigned short port,
414 int connection_timeout =
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:250
Implementation of Gcs_mysql_network_provider_auth_interface that retrieves auth data from MySQL.
Definition: gcs_mysql_network_provider.h:69
Gcs_mysql_network_provider_auth_interface_impl()
Definition: gcs_mysql_network_provider.h:71
Replication_thread_api m_recovery_channel
Definition: gcs_mysql_network_provider.h:83
virtual ~Gcs_mysql_network_provider_auth_interface_impl() override
Definition: gcs_mysql_network_provider.h:73
bool get_credentials(std::string &username, std::string &password) override
Get the user credentials needed to establish MySQL connections.
Definition: gcs_mysql_network_provider.cc:40
IoC interface to allow abstraction of the retrieval of Security Credentials.
Definition: gcs_mysql_network_provider.h:43
virtual bool get_credentials(std::string &username, std::string &password)=0
Get the user credentials needed to establish MySQL connections.
virtual ~Gcs_mysql_network_provider_auth_interface()
Definition: gcs_mysql_network_provider.h:45
Internal implementation of Gcs_mysql_network_provider_native_interface_impl that serves as a proxy fo...
Definition: gcs_mysql_network_provider.h:217
MYSQL * mysql_init(MYSQL *sock) override
Implementation of.
Definition: gcs_mysql_network_provider.cc:59
bool restore_original_network_namespace() override
Implementation of.
Definition: gcs_mysql_network_provider.cc:121
int channel_get_network_namespace(std::string &net_ns) override
Implementation of.
Definition: gcs_mysql_network_provider.cc:93
bool set_network_namespace(const std::string &network_namespace) override
Implementation of.
Definition: gcs_mysql_network_provider.cc:106
void mysql_free(void *ptr) override
Implementation of.
Definition: gcs_mysql_network_provider.cc:73
virtual ~Gcs_mysql_network_provider_native_interface_impl() override
Definition: gcs_mysql_network_provider.h:221
Gcs_mysql_network_provider_native_interface_impl()
Definition: gcs_mysql_network_provider.h:219
int mysql_options(MYSQL *mysql, enum mysql_option option, const void *arg) override
Implementation of.
Definition: gcs_mysql_network_provider.cc:77
bool mysql_ssl_set(MYSQL *mysql, const char *key, const char *cert, const char *ca, const char *capath, const char *cipher) override
Implementation of.
Definition: gcs_mysql_network_provider.cc:82
Replication_thread_api m_recovery_channel
Definition: gcs_mysql_network_provider.h:291
MYSQL * mysql_real_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int port, const char *unix_socket, unsigned long clientflag) override
Implementation of.
Definition: gcs_mysql_network_provider.cc:45
bool send_command(MYSQL *mysql, enum enum_server_command command, const unsigned char *arg, size_t length, bool skip_check) override
Implementation of.
Definition: gcs_mysql_network_provider.cc:53
void mysql_close(MYSQL *sock) override
Implementation of.
Definition: gcs_mysql_network_provider.cc:64
IoC interface to allow abstraction of MySQL Client API.
Definition: gcs_mysql_network_provider.h:90
virtual MYSQL * mysql_init(MYSQL *sock)=0
Proxy method to mysql_init from the MySQL Client API.
virtual int channel_get_network_namespace(std::string &net_ns)=0
Method to get the network namespace configured for a channel.
virtual bool send_command(MYSQL *mysql, enum enum_server_command command, const unsigned char *arg, size_t length, bool skip_check)=0
Proxy method to simple_command from the MySQL client API.
virtual void mysql_close(MYSQL *sock)=0
Proxy method to mysql_close from the MySQL Client API.
virtual int mysql_options(MYSQL *mysql, enum mysql_option option, const void *arg)=0
Proxy method to mysql_options from the MySQL Memory API.
virtual bool restore_original_network_namespace()=0
Restore original network namespace used to be active before a new network namespace has been set.
virtual void mysql_free(void *ptr)=0
Proxy method to mysql_free from the MySQL Memory API.
virtual bool set_network_namespace(const std::string &network_namespace)=0
Set active network namespace specified by a name.
virtual MYSQL * mysql_real_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int port, const char *unix_socket, unsigned long clientflag)=0
Proxy method to mysql_real_connect from the MySQL client API.
virtual ~Gcs_mysql_network_provider_native_interface()
Definition: gcs_mysql_network_provider.h:92
virtual bool mysql_ssl_set(MYSQL *mysql, const char *key, const char *cert, const char *ca, const char *capath, const char *cipher)=0
Proxy method to mysql_ssl_set from the MySQL Memory API.
Implementation of a.
Definition: gcs_mysql_network_provider.h:298
std::map< int, THD * > m_incoming_connection_map
A map that holds THD's for all open MySQL Server connections.
Definition: gcs_mysql_network_provider.h:319
Network_configuration_parameters m_config_parameters
Definition: gcs_mysql_network_provider.h:325
enum_transport_protocol get_communication_stack() const override
Get the communication stack implemented by this class.
Definition: gcs_mysql_network_provider.h:389
mysql_mutex_t m_GR_LOCK_connection_map_mutex
Definition: gcs_mysql_network_provider.h:322
int close_connection(const Network_connection &connection) override
Closes an open connection to another XCom endpoint served by the same Network provider.
Definition: gcs_mysql_network_provider.cc:333
Gcs_mysql_network_provider_auth_interface * m_auth_provider
External IoC dependencies.
Definition: gcs_mysql_network_provider.h:332
std::pair< bool, int > stop() override
See.
Definition: gcs_mysql_network_provider.cc:135
bool configure_secure_connections(const Network_configuration_parameters ¶ms) override
See.
Definition: gcs_mysql_network_provider.cc:163
std::pair< bool, int > start() override
See.
Definition: gcs_mysql_network_provider.cc:129
bool finalize_secure_connections_context() override
Definition: gcs_mysql_network_provider.cc:192
bool configure(const Network_configuration_parameters ¶ms) override
See.
Definition: gcs_mysql_network_provider.cc:158
std::unique_ptr< Network_connection > open_connection(const std::string &address, const unsigned short port, const Network_security_credentials &security_credentials, int connection_timeout=Network_provider::default_connection_timeout()) override
See.
Definition: gcs_mysql_network_provider.cc:196
virtual ~Gcs_mysql_network_provider() override
Definition: gcs_mysql_network_provider.h:361
void cleanup_secure_connections_context() override
Definition: gcs_mysql_network_provider.cc:186
Gcs_mysql_network_provider_native_interface * m_native_interface
Definition: gcs_mysql_network_provider.h:333
std::map< int, MYSQL * > m_connection_map
A map that holds all open MySQL client connections.
Definition: gcs_mysql_network_provider.h:309
void set_new_connection(THD *thd, Network_connection *connection)
Set the new connection coming form MySQL server.
Definition: gcs_mysql_network_provider.cc:366
Gcs_mysql_network_provider(Gcs_mysql_network_provider_auth_interface *auth_provider, Gcs_mysql_network_provider_native_interface *native_interface)
Construct a new Gcs_mysql_network_provider.
Definition: gcs_mysql_network_provider.h:344
Class that provides Network Namespace services.
Definition: network_provider.h:215
Base class for External Network Providers.
Definition: network_provider.h:268
static constexpr int default_connection_timeout()
Definition: network_provider.h:424
Definition: replication_threads_api.h:36
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:35
#define mysql_mutex_destroy(M)
Definition: mysql_mutex.h:45
#define mysql_mutex_init(K, M, A)
Definition: mysql_mutex.h:40
enum_server_command
A list of all MySQL protocol commands.
Definition: my_command.h:47
This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient.
mysql_option
Definition: mysql.h:167
static char * password
Definition: mysql_secure_installation.cc:57
char * user
Definition: mysqladmin.cc:64
const char * host
Definition: mysqladmin.cc:63
static MYSQL * sock
Definition: mysqlcheck.cc:56
void for_each(const Shards< COUNT > &shards, Function &&f) noexcept
Iterate over the shards.
Definition: ut0counter.h:322
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
Definition: instrumented_condition_variable.h:31
enum_transport_protocol
Enum that describes the available XCom Communication Stacks.
Definition: network_provider.h:44
@ MYSQL_PROTOCOL
Definition: network_provider.h:47
@ SSL_DISABLED
Definition: network_provider.h:56
PSI_mutex_key key_GR_LOCK_connection_map
Definition: plugin_psi.h:132
required string key
Definition: replication_asynchronous_connection_failover.proto:59
required string network_namespace
Definition: replication_asynchronous_connection_failover.proto:33
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:32
Possible configuration parameters.
Definition: network_provider.h:153
struct ssl_parameters ssl_params
Definition: network_provider.h:156
Represents an open connection.
Definition: network_provider.h:163
Security credentials to establish a connection.
Definition: network_provider.h:96
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
int ssl_mode
Definition: network_provider.h:134
#define MY_MUTEX_INIT_FAST
Definition: thr_mutex.h:67
command
Definition: version_token.cc:279