summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2005-10-12 21:25:04 +0200
committerunknown <guilhem@mysql.com>2005-10-12 21:25:04 +0200
commit3f11381b7c27dba3a0b387b642f4353c4d18cb7e (patch)
treedd88685542501689063b16498a83d135ee9fe2b0 /sql/slave.cc
parent8d9c66a53c146d31ea27eaa5de15c857cfb11628 (diff)
parent149a283389d1c496fd677cd207f62cdedad98e9e (diff)
downloadmariadb-git-3f11381b7c27dba3a0b387b642f4353c4d18cb7e.tar.gz
slave.cc:
SCCS merged sql/slave.cc: SCCS merged
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 821b1c66d5c..09b1d79b1de 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1722,9 +1722,26 @@ static int init_relay_log_info(RELAY_LOG_INFO* rli,
{
char buf[FN_REFLEN];
const char *ln;
+ static bool name_warning_sent= 0;
ln= rli->relay_log.generate_name(opt_relay_logname, "-relay-bin",
1, buf);
-
+ /* We send the warning only at startup, not after every RESET SLAVE */
+ if (!opt_relay_logname && !opt_relaylog_index_name && !name_warning_sent)
+ {
+ /*
+ User didn't give us info to name the relay log index file.
+ Picking `hostname`-relay-bin.index like we do, causes replication to
+ fail if this slave's hostname is changed later. So, we would like to
+ instead require a name. But as we don't want to break many existing
+ setups, we only give warning, not error.
+ */
+ sql_print_warning("Neither --relay-log nor --relay-log-index were used;"
+ " so replication "
+ "may break when this MySQL server acts as a "
+ "slave and has his hostname changed!! Please "
+ "use '--relay-log=%s' to avoid this problem.", ln);
+ name_warning_sent= 1;
+ }
/*
note, that if open() fails, we'll still have index file open
but a destructor will take care of that