summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorsasha@mysql.sashanet.com <>2001-10-09 20:59:42 -0600
committersasha@mysql.sashanet.com <>2001-10-09 20:59:42 -0600
commitaf82bc245b2ce336823457d783b3e838fa70051e (patch)
treeb88da361c2634a62ad2add0ca9097837f0ebda5a /sql/mysqld.cc
parente05b83921ddacf724ed1dd6a37321c75dc978d63 (diff)
parentd7c47dcf86ad5fac58e33be29b5ecc2a1d06151c (diff)
downloadmariadb-git-af82bc245b2ce336823457d783b3e838fa70051e.tar.gz
merged
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1a84877df05..870c241af13 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -21,6 +21,7 @@
#include "sql_acl.h"
#include "slave.h"
#include "sql_repl.h"
+#include "repl_failsafe.h"
#include "stacktrace.h"
#ifdef HAVE_BERKELEY_DB
#include "ha_berkeley.h"
@@ -1684,6 +1685,7 @@ int main(int argc, char **argv)
(void) pthread_mutex_init(&LOCK_slave, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_server_id, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST);
(void) pthread_cond_init(&COND_thread_count,NULL);
(void) pthread_cond_init(&COND_refresh,NULL);
(void) pthread_cond_init(&COND_thread_cache,NULL);
@@ -1692,6 +1694,7 @@ int main(int argc, char **argv)
(void) pthread_cond_init(&COND_binlog_update, NULL);
(void) pthread_cond_init(&COND_slave_stopped, NULL);
(void) pthread_cond_init(&COND_slave_start, NULL);
+ (void) pthread_cond_init(&COND_rpl_status, NULL);
init_signals();
if (set_default_charset_by_name(default_charset, MYF(MY_WME)))
@@ -3052,6 +3055,8 @@ struct show_var_st status_vars[]= {
{"Open_streams", (char*) &my_stream_opened, SHOW_INT_CONST},
{"Opened_tables", (char*) &opened_tables, SHOW_LONG},
{"Questions", (char*) 0, SHOW_QUESTION},
+ {"Rpl_status", (char*) 0,
+ SHOW_RPL_STATUS},
{"Select_full_join", (char*) &select_full_join_count, SHOW_LONG},
{"Select_full_range_join", (char*) &select_full_range_join_count, SHOW_LONG},
{"Select_range", (char*) &select_range_count, SHOW_LONG},
@@ -3489,6 +3494,17 @@ static void get_options(int argc,char **argv)
opt_log_slave_updates = 1;
break;
+ case (int) OPT_INIT_RPL_ROLE:
+ {
+ int role;
+ if ((role=find_type(optarg, &rpl_role_typelib, 2)) <= 0)
+ {
+ fprintf(stderr, "Unknown replication role: %s\n", optarg);
+ exit(1);
+ }
+ rpl_status = (rpl_role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE;
+ break;
+ }
case (int)OPT_REPLICATE_IGNORE_DB:
{
i_string *db = new i_string(optarg);