24#ifndef RPL_MYSQL_CONNECT
25#define RPL_MYSQL_CONNECT
Mysql client connection wrapper class to connect MySQL, execute SQL query and fetch query results.
Definition: rpl_mysql_connect.h:56
bool m_is_io_thread
Definition: rpl_mysql_connect.h:137
bool m_connected
Definition: rpl_mysql_connect.h:116
Mysql_connection(THD *thd, Master_info *mi, std::string host, uint port, std::string network_namespace, bool is_io_thread=false)
Mysql_connection class constructor.
Definition: rpl_mysql_connect.cc:31
bool safe_reconnect(THD *thd, Master_info *mi, bool suppress_warnings, std::string host, uint port)
To re-connect to mysql server.
Definition: rpl_mysql_connect.cc:94
std::string m_network_namespace
Definition: rpl_mysql_connect.h:134
bool is_connected()
Determine if its connected to mysql server.
Definition: rpl_mysql_connect.cc:60
bool safe_connect(THD *thd, Master_info *mi, std::string host, uint port, std::string network_namespace)
To connect to mysql server.
Definition: rpl_mysql_connect.cc:62
std::string m_host
Definition: rpl_mysql_connect.h:128
MYSQL_RES_TUPLE execute_query(std::string query) const
Execute given sql query on connected mysql server.
Definition: rpl_mysql_connect.cc:114
MYSQL * m_conn
Definition: rpl_mysql_connect.h:113
THD * m_thd
Definition: rpl_mysql_connect.h:122
~Mysql_connection()
Mysql_connection class destructor.
Definition: rpl_mysql_connect.cc:51
bool reconnect()
Re-connect to mysql server.
Definition: rpl_mysql_connect.cc:104
Master_info * m_mi
Definition: rpl_mysql_connect.h:125
uint m_port
Definition: rpl_mysql_connect.h:131
bool m_init
Definition: rpl_mysql_connect.h:119
MYSQL * get_mysql()
Get Mysql client connection object.
Definition: rpl_mysql_connect.h:97
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
static char * query
Definition: myisam_ftdump.cc:47
This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient.
const char * host
Definition: mysqladmin.cc:65
required string network_namespace
Definition: replication_asynchronous_connection_failover.proto:34
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
std::vector< std::vector< std::string > > MYSQL_RES_VAL
result of executed query in rows<cols<value>> format where rows and cols both are std::vector and val...
Definition: rpl_mysql_connect.h:36
std::tuple< uint, std::vector< std::vector< std::string > > > MYSQL_RES_TUPLE
std::tuple<error number, result> where first element of tuple is function return value and determines...
Definition: rpl_mysql_connect.h:48