summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2001-01-24 09:15:34 -0700
committerunknown <sasha@mysql.sashanet.com>2001-01-24 09:15:34 -0700
commit262a9e41e164b1ddbb1763622bf5617d3685f74a (patch)
tree389b1cade6be60d713c322e9f923adb3578a60d6 /sql/sql_repl.cc
parent32250dfcedc1aad01da5ba7658fed1398737bedd (diff)
downloadmariadb-git-262a9e41e164b1ddbb1763622bf5617d3685f74a.tar.gz
Added last_errno and last_error to show slave status
slave will skip the first SQL_SLAVE_SKIP_COUNTER events on start - this is needed to recover from broken replication when the next log event(s) should just be skipped. Rotate binlogs when max_binlog_size is reached include/my_sys.h: added my_snprintf() include/mysqld_error.h: more error messages mysql-test/r/rpl000014.result: updated results for new SHOW SLAVE STATUS format mysql-test/r/rpl000015.result: update for SHOW SLAVE STATUS mysql-test/r/rpl000016.result: update for additions to the test mysql-test/t/rpl000016.test: test max_binlog_size and slave_skip_counter mysys/my_vsnprintf.c: added my_snprintf() sql/gen_lex_hash.cc: old values could not do it sql/lex.h: updates for SQL_SLAVE_SKIP_COUNTER sql/log.cc: rotate binlogs when max_binlog_size is reached sql/mysqld.cc: added max_binlog_size sql/share/czech/errmsg.txt: new errors sql/share/danish/errmsg.txt: new errors sql/share/dutch/errmsg.txt: new errors sql/share/english/errmsg.txt: new errors sql/share/estonian/errmsg.txt: new errors sql/share/french/errmsg.txt: new errors sql/share/german/errmsg.txt: new errors sql/share/greek/errmsg.txt: new errors sql/share/hungarian/errmsg.txt: new errors sql/share/italian/errmsg.txt: new errors sql/share/japanese/errmsg.txt: new errors sql/share/korean/errmsg.txt: new errors sql/share/norwegian-ny/errmsg.txt: new errors sql/share/norwegian/errmsg.txt: new errors sql/share/polish/errmsg.txt: new errors sql/share/portuguese/errmsg.txt: new errors sql/share/romanian/errmsg.txt: new errors sql/share/russian/errmsg.txt: new errors, translated untranslated messages sql/share/slovak/errmsg.txt: new errors sql/share/spanish/errmsg.txt: new errors sql/share/swedish/errmsg.txt: new errors sql/slave.cc: updates for slave_skip_counter and extension to show slave status sql/slave.h: slave_skip_counter sql/sql_repl.cc: use error messages from errmsg.txt sql/sql_yacc.yy: skip_slave_counter
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index f4564c025e0..edf4727c2f1 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -519,34 +519,34 @@ int start_slave(THD* thd , bool net_report)
{
if(!thd) thd = current_thd;
NET* net = &thd->net;
- const char* err = 0;
+ int slave_errno = 0;
if (check_access(thd, PROCESS_ACL, any_db))
return 1;
pthread_mutex_lock(&LOCK_slave);
if(!slave_running)
{
if(init_master_info(&glob_mi))
- err = "Could not initialize master info";
+ slave_errno = ER_MASTER_INFO;
else if(server_id_supplied && *glob_mi.host)
{
pthread_t hThread;
if(pthread_create(&hThread, &connection_attrib, handle_slave, 0))
{
- err = "cannot create slave thread";
+ slave_errno = ER_SLAVE_THREAD;
}
while(!slave_running) // slave might already be running by now
pthread_cond_wait(&COND_slave_start, &LOCK_slave);
}
else
- err = "Master host not set, or server id not configured";
+ slave_errno = ER_BAD_SLAVE;
}
else
- err = "Slave already running";
+ slave_errno = ER_SLAVE_MUST_STOP;
pthread_mutex_unlock(&LOCK_slave);
- if(err)
+ if(slave_errno)
{
- if(net_report) send_error(net, 0, err);
+ if(net_report) send_error(net, slave_errno);
return 1;
}
else if(net_report)
@@ -559,8 +559,8 @@ int stop_slave(THD* thd, bool net_report )
{
if(!thd) thd = current_thd;
NET* net = &thd->net;
- const char* err = 0;
-
+ int slave_errno = 0;
+
if (check_access(thd, PROCESS_ACL, any_db))
return 1;
@@ -576,14 +576,14 @@ int stop_slave(THD* thd, bool net_report )
pthread_cond_wait(&COND_slave_stopped, &LOCK_slave);
}
else
- err = "Slave is not running";
+ slave_errno = ER_SLAVE_NOT_RUNNING;
pthread_mutex_unlock(&LOCK_slave);
thd->proc_info = 0;
- if(err)
+ if(slave_errno)
{
- if(net_report) send_error(net, 0, err);
+ if(net_report) send_error(net, slave_errno);
return 1;
}
else if(net_report)