summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2015-10-08 10:45:32 +0300
committerMonty <monty@mariadb.org>2015-10-08 10:45:32 +0300
commit6dd41145ac6d33db08157e96cbc3b400b54f898b (patch)
tree0f151c8fda7bd20567f91e2cc178594c60da426e
parenta69a6ddac8175a611d97711d167e26ad5d1f9dc8 (diff)
downloadmariadb-git-6dd41145ac6d33db08157e96cbc3b400b54f898b.tar.gz
Better error messages if slave is not properly configured
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_reset_slave.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_reset_slave.result2
-rw-r--r--sql/sql_repl.cc16
3 files changed, 15 insertions, 5 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
index 1cf70ba7e67..33284ce58c6 100644
--- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
@@ -47,7 +47,7 @@ include/start_slave.inc
include/stop_slave.inc
reset slave all;
start slave;
-ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
+ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO
CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
index e5870cec2c9..7eb29085099 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
@@ -47,7 +47,7 @@ include/start_slave.inc
include/stop_slave.inc
reset slave all;
start slave;
-ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
+ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO
CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
include/start_slave.inc
include/rpl_end.inc
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 31e2cc2d269..d6a4819172d 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -2869,7 +2869,19 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
if (init_master_info(mi,master_info_file_tmp,relay_log_info_file_tmp, 0,
thread_mask))
slave_errno=ER_MASTER_INFO;
- else if (server_id_supplied && *mi->host)
+ else if (!server_id_supplied)
+ {
+ slave_errno= ER_BAD_SLAVE; net_report= 0;
+ my_message(slave_errno, "Misconfigured slave: server_id was not set; Fix in config file",
+ MYF(0));
+ }
+ else if (!*mi->host)
+ {
+ slave_errno= ER_BAD_SLAVE; net_report= 0;
+ my_message(slave_errno, "Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO",
+ MYF(0));
+ }
+ else
{
/*
If we will start SQL thread we will care about UNTIL options If
@@ -2963,8 +2975,6 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
relay_log_info_file_tmp,
thread_mask);
}
- else
- slave_errno = ER_BAD_SLAVE;
}
else
{