Skip to content

Commit 88e5b9d

Browse files
author
Luis Soares
committed
BUG#54144: manual merged bzr bundle from bug report.
--BZR-- revision-id: luis.soares@oracle.com-20101007233459-xvrciazs069umx06 property-branch-nick: mysql-5.5-bugteam testament3-sha1: 10f3e027ef7bd010eaffeb532f1cfffd30a37eda
2 parents 1f2656e + 0ac0477 commit 88e5b9d

5 files changed

Lines changed: 34 additions & 37 deletions

File tree

mysql-test/suite/rpl/r/rpl_heartbeat.result

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ show status like 'Slave_heartbeat_period';;
66
Variable_name Slave_heartbeat_period
77
Value 5.000
88
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4294968;
9-
ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
9+
ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
1010
show status like 'Slave_heartbeat_period';;
1111
Variable_name Slave_heartbeat_period
1212
Value 5.000
1313
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.0009999;
1414
Warnings:
15-
Warning 1624 The requested value for the heartbeat period is less than 1 msec. The period is reset to zero which means no heartbeats will be sending
15+
Warning 1703 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.
1616
show status like 'Slave_heartbeat_period';;
1717
Variable_name Slave_heartbeat_period
1818
Value 0.000
1919
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4294967;
2020
Warnings:
21-
Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
21+
Warning 1704 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.
2222
show status like 'Slave_heartbeat_period';;
2323
Variable_name Slave_heartbeat_period
2424
Value 4294967.000
@@ -30,7 +30,7 @@ reset slave;
3030
set @@global.slave_net_timeout= 5;
3131
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 5.001;
3232
Warnings:
33-
Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
33+
Warning 1704 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.
3434
show status like 'Slave_heartbeat_period';;
3535
Variable_name Slave_heartbeat_period
3636
Value 5.001
@@ -42,7 +42,7 @@ Variable_name Slave_heartbeat_period
4242
Value 4.000
4343
set @@global.slave_net_timeout= 3 /* must be a warning */;
4444
Warnings:
45-
Warning 1624 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.
45+
Warning 1704 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.
4646
reset slave;
4747
drop table if exists t1;
4848
set @@global.slave_net_timeout= 10;

mysql-test/suite/rpl/r/rpl_heartbeat_basic.result

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ RESET SLAVE;
3838
*** Warning if updated slave_net_timeout < slave_heartbeat_timeout ***
3939
SET @@global.slave_net_timeout=FLOOR(SLAVE_HEARTBEAT_TIMEOUT)-1;
4040
Warnings:
41-
Warning 1624 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.
41+
Warning 1704 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.
4242
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
4343
RESET SLAVE;
4444

4545
*** Warning if updated slave_heartbeat_timeout > slave_net_timeout ***
4646
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=SLAVE_NET_TIMEOUT;
4747
Warnings:
48-
Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
48+
Warning 1704 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.
4949
RESET SLAVE;
5050

5151
*** CHANGE MASTER statement only updates slave_heartbeat_period ***
@@ -140,7 +140,7 @@ Slave_heartbeat_period 0.001
140140
RESET SLAVE;
141141
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.0009;
142142
Warnings:
143-
Warning 1624 The requested value for the heartbeat period is less than 1 msec. The period is reset to zero which means no heartbeats will be sending
143+
Warning 1703 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.
144144
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
145145
Variable_name Value
146146
Slave_heartbeat_period 0.000
@@ -149,19 +149,19 @@ RESET SLAVE;
149149
*** Max slave_heartbeat_timeout ***
150150
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967;
151151
Warnings:
152-
Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
152+
Warning 1704 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.
153153
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
154154
Variable_name Value
155155
Slave_heartbeat_period 4294967.000
156156
RESET SLAVE;
157157
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294968;
158-
ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
158+
ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
159159
RESET SLAVE;
160160
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=8589935;
161-
ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
161+
ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
162162
RESET SLAVE;
163163
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967296;
164-
ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
164+
ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
165165
RESET SLAVE;
166166

167167
*** Misc incorrect values ***

sql/share/errmsg-utf8.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6152,7 +6152,7 @@ ER_WARN_ENGINE_TRANSACTION_ROLLBACK
61526152
ER_SLAVE_HEARTBEAT_FAILURE
61536153
eng "Unexpected master's heartbeat data: %s"
61546154
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
6155-
eng "The requested value for the heartbeat period %s %s"
6155+
eng "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%s seconds)."
61566156

61576157
ER_NDB_REPLICATION_SCHEMA_ERROR
61586158
eng "Bad schema for mysql.ndb_replication table. Message: %-.64s"
@@ -6385,3 +6385,10 @@ ER_TRUNCATE_ILLEGAL_FK 42000
63856385

63866386
ER_PLUGIN_IS_PERMANENT
63876387
eng "Plugin '%s' is force_plus_permanent and can not be unloaded"
6388+
6389+
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN
6390+
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."
6391+
6392+
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX
6393+
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."
6394+

sql/sql_yacc.yy

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,35 +1933,28 @@ master_def:
19331933
| MASTER_HEARTBEAT_PERIOD_SYM EQ NUM_literal
19341934
{
19351935
Lex->mi.heartbeat_period= (float) $3->val_real();
1936-
if (Lex->mi.heartbeat_period > SLAVE_MAX_HEARTBEAT_PERIOD ||
1937-
Lex->mi.heartbeat_period < 0.0)
1938-
{
1939-
const char format[]= "%d seconds";
1940-
char buf[4*sizeof(SLAVE_MAX_HEARTBEAT_PERIOD) + sizeof(format)];
1941-
sprintf(buf, format, SLAVE_MAX_HEARTBEAT_PERIOD);
1942-
my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
1943-
MYF(0), " is negative or exceeds the maximum ", buf);
1944-
MYSQL_YYABORT;
1936+
if (Lex->mi.heartbeat_period > SLAVE_MAX_HEARTBEAT_PERIOD ||
1937+
Lex->mi.heartbeat_period < 0.0)
1938+
{
1939+
const char format[]= "%d";
1940+
char buf[4*sizeof(SLAVE_MAX_HEARTBEAT_PERIOD) + sizeof(format)];
1941+
sprintf(buf, format, SLAVE_MAX_HEARTBEAT_PERIOD);
1942+
my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE, MYF(0), buf);
1943+
MYSQL_YYABORT;
19451944
}
19461945
if (Lex->mi.heartbeat_period > slave_net_timeout)
19471946
{
19481947
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
1949-
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
1950-
ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
1951-
" exceeds the value of `slave_net_timeout' sec.",
1952-
" A sensible value for the period should be"
1953-
" less than the timeout.");
1948+
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX,
1949+
ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX));
19541950
}
19551951
if (Lex->mi.heartbeat_period < 0.001)
19561952
{
19571953
if (Lex->mi.heartbeat_period != 0.0)
19581954
{
19591955
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
1960-
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
1961-
ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
1962-
" is less than 1 msec.",
1963-
" The period is reset to zero which means"
1964-
" no heartbeats will be sending");
1956+
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN,
1957+
ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN));
19651958
Lex->mi.heartbeat_period= 0.0;
19661959
}
19671960
Lex->mi.heartbeat_opt= LEX_MASTER_INFO::LEX_MI_DISABLE;

sql/sys_vars.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,11 +2943,8 @@ static bool fix_slave_net_timeout(sys_var *self, THD *thd, enum_var_type type)
29432943
(active_mi? active_mi->heartbeat_period : 0.0)));
29442944
if (active_mi && slave_net_timeout < active_mi->heartbeat_period)
29452945
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
2946-
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
2947-
"The current value for master_heartbeat_period"
2948-
" exceeds the new value of `slave_net_timeout' sec."
2949-
" A sensible value for the period should be"
2950-
" less than the timeout.");
2946+
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX,
2947+
ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX));
29512948
mysql_mutex_unlock(&LOCK_active_mi);
29522949
return false;
29532950
}

0 commit comments

Comments
 (0)