summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@oracle.com>2010-10-08 00:34:59 +0100
committerLuis Soares <luis.soares@oracle.com>2010-10-08 00:34:59 +0100
commite514a7a644f6fcb553463f7bdefb73174c112d87 (patch)
tree388dff9a4a8780ebd595f1e2a6a3f1822ed0d914 /sql
parent76643a469a58beee1ffff9636c87eb8c36f2177d (diff)
parentcc15d2462cf0b32576010d1810960969cba48182 (diff)
downloadmariadb-git-e514a7a644f6fcb553463f7bdefb73174c112d87.tar.gz
BUG#54144: manual merged bzr bundle from bug report.
Diffstat (limited to 'sql')
-rw-r--r--sql/share/errmsg-utf8.txt9
-rw-r--r--sql/sql_yacc.yy31
-rw-r--r--sql/sys_vars.cc7
3 files changed, 22 insertions, 25 deletions
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 74a51fb49b3..be97afe055a 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -6152,7 +6152,7 @@ ER_WARN_ENGINE_TRANSACTION_ROLLBACK
ER_SLAVE_HEARTBEAT_FAILURE
eng "Unexpected master's heartbeat data: %s"
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
- eng "The requested value for the heartbeat period %s %s"
+ eng "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%s seconds)."
ER_NDB_REPLICATION_SCHEMA_ERROR
eng "Bad schema for mysql.ndb_replication table. Message: %-.64s"
@@ -6385,3 +6385,10 @@ ER_TRUNCATE_ILLEGAL_FK 42000
ER_PLUGIN_IS_PERMANENT
eng "Plugin '%s' is force_plus_permanent and can not be unloaded"
+
+ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN
+ eng "The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled."
+
+ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX
+ eng "The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout."
+
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 2fc39757511..d73dff9aaeb 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1933,35 +1933,28 @@ master_def:
| MASTER_HEARTBEAT_PERIOD_SYM EQ NUM_literal
{
Lex->mi.heartbeat_period= (float) $3->val_real();
- if (Lex->mi.heartbeat_period > SLAVE_MAX_HEARTBEAT_PERIOD ||
- Lex->mi.heartbeat_period < 0.0)
- {
- const char format[]= "%d seconds";
- char buf[4*sizeof(SLAVE_MAX_HEARTBEAT_PERIOD) + sizeof(format)];
- sprintf(buf, format, SLAVE_MAX_HEARTBEAT_PERIOD);
- my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
- MYF(0), " is negative or exceeds the maximum ", buf);
- MYSQL_YYABORT;
+ if (Lex->mi.heartbeat_period > SLAVE_MAX_HEARTBEAT_PERIOD ||
+ Lex->mi.heartbeat_period < 0.0)
+ {
+ const char format[]= "%d";
+ char buf[4*sizeof(SLAVE_MAX_HEARTBEAT_PERIOD) + sizeof(format)];
+ sprintf(buf, format, SLAVE_MAX_HEARTBEAT_PERIOD);
+ my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE, MYF(0), buf);
+ MYSQL_YYABORT;
}
if (Lex->mi.heartbeat_period > slave_net_timeout)
{
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
- ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
- " exceeds the value of `slave_net_timeout' sec.",
- " A sensible value for the period should be"
- " less than the timeout.");
+ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX,
+ ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX));
}
if (Lex->mi.heartbeat_period < 0.001)
{
if (Lex->mi.heartbeat_period != 0.0)
{
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
- ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
- " is less than 1 msec.",
- " The period is reset to zero which means"
- " no heartbeats will be sending");
+ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN,
+ ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN));
Lex->mi.heartbeat_period= 0.0;
}
Lex->mi.heartbeat_opt= LEX_MASTER_INFO::LEX_MI_DISABLE;
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 69a01259fc0..b8b73bc0387 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -2943,11 +2943,8 @@ static bool fix_slave_net_timeout(sys_var *self, THD *thd, enum_var_type type)
(active_mi? active_mi->heartbeat_period : 0.0)));
if (active_mi && slave_net_timeout < active_mi->heartbeat_period)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
- "The current value for master_heartbeat_period"
- " exceeds the new value of `slave_net_timeout' sec."
- " A sensible value for the period should be"
- " less than the timeout.");
+ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX,
+ ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX));
mysql_mutex_unlock(&LOCK_active_mi);
return false;
}