Commit 529120e1 authored by Andrei Elkin's avatar Andrei Elkin Committed by Monty

MDEV-13073. This patch is a followup of the previous one to convert the...

MDEV-13073. This patch is a followup of the previous one to convert the trailing underscore identifier to mariadb standard. For identifier representing class private members the underscore is replaced with a `m_` prefix. Otherwise `_` is just removed.
parent f279d3c4
...@@ -33,13 +33,13 @@ class Trace { ...@@ -33,13 +33,13 @@ class Trace {
static const unsigned long k_trace_detail; static const unsigned long k_trace_detail;
static const unsigned long k_trace_net_wait; static const unsigned long k_trace_net_wait;
unsigned long trace_level_; /* the level for tracing */ unsigned long m_trace_level; /* the level for tracing */
Trace() Trace()
:trace_level_(0L) :m_trace_level(0L)
{} {}
Trace(unsigned long trace_level) Trace(unsigned long trace_level)
:trace_level_(trace_level) :m_trace_level(trace_level)
{} {}
}; };
......
This diff is collapsed.
...@@ -28,10 +28,10 @@ extern PSI_cond_key key_COND_binlog_send; ...@@ -28,10 +28,10 @@ extern PSI_cond_key key_COND_binlog_send;
#endif #endif
struct Tranx_node { struct Tranx_node {
char log_name_[FN_REFLEN]; char log_name[FN_REFLEN];
my_off_t log_pos_; my_off_t log_pos;
struct Tranx_node *next_; /* the next node in the sorted list */ struct Tranx_node *next; /* the next node in the sorted list */
struct Tranx_node *hash_next_; /* the next node during hash collision */ struct Tranx_node *hash_next; /* the next node during hash collision */
}; };
/** /**
...@@ -123,10 +123,10 @@ class Tranx_node_allocator ...@@ -123,10 +123,10 @@ class Tranx_node_allocator
} }
trx_node= &(current_block->nodes[++last_node]); trx_node= &(current_block->nodes[++last_node]);
trx_node->log_name_[0] = '\0'; trx_node->log_name[0] = '\0';
trx_node->log_pos_= 0; trx_node->log_pos= 0;
trx_node->next_= 0; trx_node->next= 0;
trx_node->hash_next_= 0; trx_node->hash_next= 0;
return trx_node; return trx_node;
} }
...@@ -299,14 +299,14 @@ class Active_tranx ...@@ -299,14 +299,14 @@ class Active_tranx
:public Trace { :public Trace {
private: private:
Tranx_node_allocator allocator_; Tranx_node_allocator m_allocator;
/* These two record the active transaction list in sort order. */ /* These two record the active transaction list in sort order. */
Tranx_node *trx_front_, *trx_rear_; Tranx_node *m_trx_front, *m_trx_rear;
Tranx_node **trx_htb_; /* A hash table on active transactions. */ Tranx_node **m_trx_htb; /* A hash table on active transactions. */
int num_entries_; /* maximum hash table entries */ int m_num_entries; /* maximum hash table entries */
mysql_mutex_t *lock_; /* mutex lock */ mysql_mutex_t *m_lock; /* mutex lock */
inline void assert_lock_owner(); inline void assert_lock_owner();
...@@ -316,16 +316,16 @@ class Active_tranx ...@@ -316,16 +316,16 @@ class Active_tranx
int compare(const char *log_file_name1, my_off_t log_file_pos1, int compare(const char *log_file_name1, my_off_t log_file_pos1,
const Tranx_node *node2) { const Tranx_node *node2) {
return compare(log_file_name1, log_file_pos1, return compare(log_file_name1, log_file_pos1,
node2->log_name_, node2->log_pos_); node2->log_name, node2->log_pos);
} }
int compare(const Tranx_node *node1, int compare(const Tranx_node *node1,
const char *log_file_name2, my_off_t log_file_pos2) { const char *log_file_name2, my_off_t log_file_pos2) {
return compare(node1->log_name_, node1->log_pos_, return compare(node1->log_name, node1->log_pos,
log_file_name2, log_file_pos2); log_file_name2, log_file_pos2);
} }
int compare(const Tranx_node *node1, const Tranx_node *node2) { int compare(const Tranx_node *node1, const Tranx_node *node2) {
return compare(node1->log_name_, node1->log_pos_, return compare(node1->log_name, node1->log_pos,
node2->log_name_, node2->log_pos_); node2->log_name, node2->log_pos);
} }
public: public:
...@@ -369,11 +369,11 @@ class Active_tranx ...@@ -369,11 +369,11 @@ class Active_tranx
class Repl_semi_sync_master class Repl_semi_sync_master
:public Repl_semi_sync_base { :public Repl_semi_sync_base {
private: private:
Active_tranx *active_tranxs_; /* active transaction list: the list will Active_tranx *m_active_tranxs; /* active transaction list: the list will
be cleared when semi-sync switches off. */ be cleared when semi-sync switches off. */
/* True when init_object has been called */ /* True when init_object has been called */
bool init_done_; bool m_init_done;
/* This cond variable is signaled when enough binlog has been sent to slave, /* This cond variable is signaled when enough binlog has been sent to slave,
* so that a waiting trx can return the 'ok' to the client for a commit. * so that a waiting trx can return the 'ok' to the client for a commit.
...@@ -383,32 +383,32 @@ class Repl_semi_sync_master ...@@ -383,32 +383,32 @@ class Repl_semi_sync_master
/* Mutex that protects the following state variables and the active /* Mutex that protects the following state variables and the active
* transaction list. * transaction list.
* Under no cirumstances we can acquire mysql_bin_log.LOCK_log if we are * Under no cirumstances we can acquire mysql_bin_log.LOCK_log if we are
* already holding LOCK_binlog_ because it can cause deadlocks. * already holding m_LOCK_binlog because it can cause deadlocks.
*/ */
mysql_mutex_t LOCK_binlog; mysql_mutex_t LOCK_binlog;
/* This is set to true when reply_file_name_ contains meaningful data. */ /* This is set to true when m_reply_file_name contains meaningful data. */
bool reply_file_name_inited_; bool m_reply_file_name_inited;
/* The binlog name up to which we have received replies from any slaves. */ /* The binlog name up to which we have received replies from any slaves. */
char reply_file_name_[FN_REFLEN]; char m_reply_file_name[FN_REFLEN];
/* The position in that file up to which we have the reply from any slaves. */ /* The position in that file up to which we have the reply from any slaves. */
my_off_t reply_file_pos_; my_off_t m_reply_file_pos;
/* This is set to true when we know the 'smallest' wait position. */ /* This is set to true when we know the 'smallest' wait position. */
bool wait_file_name_inited_; bool m_wait_file_name_inited;
/* NULL, or the 'smallest' filename that a transaction is waiting for /* NULL, or the 'smallest' filename that a transaction is waiting for
* slave replies. * slave replies.
*/ */
char wait_file_name_[FN_REFLEN]; char m_wait_file_name[FN_REFLEN];
/* The smallest position in that file that a trx is waiting for: the trx /* The smallest position in that file that a trx is waiting for: the trx
* can proceed and send an 'ok' to the client when the master has got the * can proceed and send an 'ok' to the client when the master has got the
* reply from the slave indicating that it already got the binlog events. * reply from the slave indicating that it already got the binlog events.
*/ */
my_off_t wait_file_pos_; my_off_t m_wait_file_pos;
/* This is set to true when we know the 'largest' transaction commit /* This is set to true when we know the 'largest' transaction commit
* position in the binlog file. * position in the binlog file.
...@@ -417,22 +417,22 @@ class Repl_semi_sync_master ...@@ -417,22 +417,22 @@ class Repl_semi_sync_master
* switch off. Binlog-dump thread can use the three fields to detect when * switch off. Binlog-dump thread can use the three fields to detect when
* slaves catch up on replication so that semi-sync can switch on again. * slaves catch up on replication so that semi-sync can switch on again.
*/ */
bool commit_file_name_inited_; bool m_commit_file_name_inited;
/* The 'largest' binlog filename that a commit transaction is seeing. */ /* The 'largest' binlog filename that a commit transaction is seeing. */
char commit_file_name_[FN_REFLEN]; char m_commit_file_name[FN_REFLEN];
/* The 'largest' position in that file that a commit transaction is seeing. */ /* The 'largest' position in that file that a commit transaction is seeing. */
my_off_t commit_file_pos_; my_off_t m_commit_file_pos;
/* All global variables which can be set by parameters. */ /* All global variables which can be set by parameters. */
volatile bool master_enabled_; /* semi-sync is enabled on the master */ volatile bool m_master_enabled; /* semi-sync is enabled on the master */
unsigned long wait_timeout_; /* timeout period(ms) during tranx wait */ unsigned long m_wait_timeout; /* timeout period(ms) during tranx wait */
bool state_; /* whether semi-sync is switched */ bool m_state; /* whether semi-sync is switched */
/*Waiting for ACK before/after innodb commit*/ /*Waiting for ACK before/after innodb commit*/
ulong wait_point_; ulong m_wait_point;
void lock(); void lock();
void unlock(); void unlock();
...@@ -441,11 +441,11 @@ class Repl_semi_sync_master ...@@ -441,11 +441,11 @@ class Repl_semi_sync_master
/* Is semi-sync replication on? */ /* Is semi-sync replication on? */
bool is_on() { bool is_on() {
return (state_); return (m_state);
} }
void set_master_enabled(bool enabled) { void set_master_enabled(bool enabled) {
master_enabled_ = enabled; m_master_enabled = enabled;
} }
/* Switch semi-sync off because of timeout in transaction waiting. */ /* Switch semi-sync off because of timeout in transaction waiting. */
...@@ -462,28 +462,28 @@ class Repl_semi_sync_master ...@@ -462,28 +462,28 @@ class Repl_semi_sync_master
void cleanup(); void cleanup();
bool get_master_enabled() { bool get_master_enabled() {
return master_enabled_; return m_master_enabled;
} }
void set_trace_level(unsigned long trace_level) { void set_trace_level(unsigned long trace_level) {
trace_level_ = trace_level; m_trace_level = trace_level;
if (active_tranxs_) if (m_active_tranxs)
active_tranxs_->trace_level_ = trace_level; m_active_tranxs->m_trace_level = trace_level;
} }
/* Set the transaction wait timeout period, in milliseconds. */ /* Set the transaction wait timeout period, in milliseconds. */
void set_wait_timeout(unsigned long wait_timeout) { void set_wait_timeout(unsigned long wait_timeout) {
wait_timeout_ = wait_timeout; m_wait_timeout = wait_timeout;
} }
/*set the ACK point, after binlog sync or after transaction commit*/ /*set the ACK point, after binlog sync or after transaction commit*/
void set_wait_point(unsigned long ack_point) void set_wait_point(unsigned long ack_point)
{ {
wait_point_ = ack_point; m_wait_point = ack_point;
} }
ulong wait_point() //no cover line ulong wait_point() //no cover line
{ {
return wait_point_; //no cover line return m_wait_point; //no cover line
} }
/* Initialize this class after MySQL parameters are initialized. this /* Initialize this class after MySQL parameters are initialized. this
...@@ -549,7 +549,7 @@ class Repl_semi_sync_master ...@@ -549,7 +549,7 @@ class Repl_semi_sync_master
/*Wait after the transaction is rollback*/ /*Wait after the transaction is rollback*/
int wait_after_rollback(THD *thd, bool all); int wait_after_rollback(THD *thd, bool all);
/*Store the current binlog position in active_tranxs_. This position should /*Store the current binlog position in m_active_tranxs. This position should
* be acked by slave*/ * be acked by slave*/
int report_binlog_update(THD *thd, const char *log_file,my_off_t log_pos); int report_binlog_update(THD *thd, const char *log_file,my_off_t log_pos);
......
...@@ -78,7 +78,7 @@ class Ack_receiver : public Repl_semi_sync_base ...@@ -78,7 +78,7 @@ class Ack_receiver : public Repl_semi_sync_base
void set_trace_level(unsigned long trace_level) void set_trace_level(unsigned long trace_level)
{ {
trace_level_= trace_level; m_trace_level= trace_level;
} }
private: private:
enum status {ST_UP, ST_DOWN, ST_STOPPING}; enum status {ST_UP, ST_DOWN, ST_STOPPING};
......
...@@ -41,7 +41,7 @@ int Repl_semi_sync_slave::init_object() ...@@ -41,7 +41,7 @@ int Repl_semi_sync_slave::init_object()
{ {
int result= 0; int result= 0;
init_done_ = true; m_init_done = true;
/* References to the parameter works after set_options(). */ /* References to the parameter works after set_options(). */
set_slave_enabled(rpl_semi_sync_slave_enabled); set_slave_enabled(rpl_semi_sync_slave_enabled);
...@@ -134,9 +134,9 @@ void Repl_semi_sync_slave::kill_connection(MYSQL *mysql) ...@@ -134,9 +134,9 @@ void Repl_semi_sync_slave::kill_connection(MYSQL *mysql)
char kill_buffer[30]; char kill_buffer[30];
MYSQL *kill_mysql = NULL; MYSQL *kill_mysql = NULL;
kill_mysql = mysql_init(kill_mysql); kill_mysql = mysql_init(kill_mysql);
mysql_options(kill_mysql, MYSQL_OPT_CONNECT_TIMEOUT, &kill_conn_timeout_); mysql_options(kill_mysql, MYSQL_OPT_CONNECT_TIMEOUT, &m_kill_conn_timeout);
mysql_options(kill_mysql, MYSQL_OPT_READ_TIMEOUT, &kill_conn_timeout_); mysql_options(kill_mysql, MYSQL_OPT_READ_TIMEOUT, &m_kill_conn_timeout);
mysql_options(kill_mysql, MYSQL_OPT_WRITE_TIMEOUT, &kill_conn_timeout_); mysql_options(kill_mysql, MYSQL_OPT_WRITE_TIMEOUT, &m_kill_conn_timeout);
bool ret= (!mysql_real_connect(kill_mysql, mysql->host, bool ret= (!mysql_real_connect(kill_mysql, mysql->host,
mysql->user, mysql->passwd,0, mysql->port, mysql->unix_socket, 0)); mysql->user, mysql->passwd,0, mysql->port, mysql->unix_socket, 0));
......
...@@ -32,11 +32,11 @@ class Master_info; ...@@ -32,11 +32,11 @@ class Master_info;
class Repl_semi_sync_slave class Repl_semi_sync_slave
:public Repl_semi_sync_base { :public Repl_semi_sync_base {
public: public:
Repl_semi_sync_slave() :slave_enabled_(false) {} Repl_semi_sync_slave() :m_slave_enabled(false) {}
~Repl_semi_sync_slave() {} ~Repl_semi_sync_slave() {}
void set_trace_level(unsigned long trace_level) { void set_trace_level(unsigned long trace_level) {
trace_level_ = trace_level; m_trace_level = trace_level;
} }
/* Initialize this class after MySQL parameters are initialized. this /* Initialize this class after MySQL parameters are initialized. this
...@@ -45,23 +45,23 @@ class Repl_semi_sync_slave ...@@ -45,23 +45,23 @@ class Repl_semi_sync_slave
int init_object(); int init_object();
bool get_slave_enabled() { bool get_slave_enabled() {
return slave_enabled_; return m_slave_enabled;
} }
void set_slave_enabled(bool enabled) { void set_slave_enabled(bool enabled) {
slave_enabled_ = enabled; m_slave_enabled = enabled;
} }
bool is_delay_master(){ bool is_delay_master(){
return delay_master_; return m_delay_master;
} }
void set_delay_master(bool enabled) { void set_delay_master(bool enabled) {
delay_master_ = enabled; m_delay_master = enabled;
} }
void set_kill_conn_timeout(unsigned int timeout) { void set_kill_conn_timeout(unsigned int timeout) {
kill_conn_timeout_ = timeout; m_kill_conn_timeout = timeout;
} }
/* A slave reads the semi-sync packet header and separate the metadata /* A slave reads the semi-sync packet header and separate the metadata
...@@ -95,10 +95,10 @@ class Repl_semi_sync_slave ...@@ -95,10 +95,10 @@ class Repl_semi_sync_slave
private: private:
/* True when init_object has been called */ /* True when init_object has been called */
bool init_done_; bool m_init_done;
bool slave_enabled_; /* semi-sycn is enabled on the slave */ bool m_slave_enabled; /* semi-sycn is enabled on the slave */
bool delay_master_; bool m_delay_master;
unsigned int kill_conn_timeout_; unsigned int m_kill_conn_timeout;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment