OK, I'll use
"The requested value"
instead of
"The value"
Regards,
Luís Soares
On Wed, 2010-10-06 at 18:55 +0300, Andrei Elkin wrote:
> Luis, hello.
>
> The fixes are good. However an observation of a minuscule size though.
> How about the text of two warnings to remain as before to begin with
> `The requested value...' ?
> You patch did not touch this prefix in one message but changes in the
> other.
>
>
> cheers,
>
> Andrei
>
>
> andrei> luis, i have one comment: [18:40]
> <andrei> while this pair is fine [18:41]
> <andrei> -ERROR HY000: The requested value for the heartbeat period is
> negative or exceeds the maximum 4294967 seconds
> <andrei> +ERROR HY000: The requested value for the heartbeat period is either
> negative or exceeds the maximum allowed (4294967 seconds).
> <andrei>
> *** thek (~kpetterss@stripped) is now known as thek|gone
> <andrei> I suggest to stick to same wording pattern in the following change:
> [18:42]
> <andrei> -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
> <andrei> +Warning 1697 The value for the heartbeat period is less
> than 1 milisecond. The period is reset to 0, meaning that
> heartbeating will effectively be disabled.
> <andrei>
> <andrei> `The requested value' vs `The value '
> <andrei> luis, let's say in this type of warn:s one of the two.
> [18:43]
>
>
> > #At file:///home/lsoares/Workspace/bzr/work/bugfixing/54144/mysql-5.5-bugfixing/
> based on revid:mats.kindahl@stripped
> >
> > 3204 Luis Soares 2010-09-27
> > BUG#54144: ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE is hard coded
> >
> > The error message for ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE was
> > hard coded. Additionally, the same error was used in three
> > separate error symptoms: 1. when heartbeat period exceeds the
> > value of slave_net_timeout, 2. when it is smaller than 1
> > milisecond and 3. when it was not in range, ie, either negative
> > or greater than the maximum allowed.
> >
> > We fix this by splitting into three distinct errors and by
> > removing the message from the source code and moving it to the
> > errmsg-utf8.txt file.
> >
> > modified:
> > mysql-test/suite/rpl/r/rpl_heartbeat.result
> > mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
> > sql/share/errmsg-utf8.txt
> > sql/sql_yacc.yy
> > sql/sys_vars.cc
> > === modified file 'mysql-test/suite/rpl/r/rpl_heartbeat.result'
> > --- a/mysql-test/suite/rpl/r/rpl_heartbeat.result 2010-05-26 14:34:25 +0000
> > +++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result 2010-09-27 16:34:13 +0000
> > @@ -6,19 +6,19 @@ show status like 'Slave_heartbeat_period
> > Variable_name Slave_heartbeat_period
> > Value 5.000
> > change master to master_host='127.0.0.1',master_port=MASTER_PORT,
> master_user='root', master_heartbeat_period= 4294968;
> > -ERROR HY000: The requested value for the heartbeat period is negative or
> exceeds the maximum 4294967 seconds
> > +ERROR HY000: The requested value for the heartbeat period is either negative or
> exceeds the maximum allowed (4294967 seconds).
> > show status like 'Slave_heartbeat_period';;
> > Variable_name Slave_heartbeat_period
> > Value 5.000
> > change master to master_host='127.0.0.1',master_port=MASTER_PORT,
> master_user='root', master_heartbeat_period= 0.0009999;
> > Warnings:
> > -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
> > +Warning 1697 The value for the heartbeat period is less than 1 milisecond. The
> period is reset to 0, meaning that heartbeating will effectively be disabled.
> > show status like 'Slave_heartbeat_period';;
> > Variable_name Slave_heartbeat_period
> > Value 0.000
> > change master to master_host='127.0.0.1',master_port=MASTER_PORT,
> master_user='root', master_heartbeat_period= 4294967;
> > Warnings:
> > -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.
> > +Warning 1698 The 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.
> > show status like 'Slave_heartbeat_period';;
> > Variable_name Slave_heartbeat_period
> > Value 4294967.000
> > @@ -30,7 +30,7 @@ reset slave;
> > set @@global.slave_net_timeout= 5;
> > change master to master_host='127.0.0.1',master_port=MASTER_PORT,
> master_user='root', master_heartbeat_period= 5.001;
> > Warnings:
> > -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.
> > +Warning 1698 The 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.
> > show status like 'Slave_heartbeat_period';;
> > Variable_name Slave_heartbeat_period
> > Value 5.001
> > @@ -42,7 +42,7 @@ Variable_name Slave_heartbeat_period
> > Value 4.000
> > set @@global.slave_net_timeout= 3 /* must be a warning */;
> > Warnings:
> > -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.
> > +Warning 1698 The 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.
> > reset slave;
> > drop table if exists t1;
> > set @@global.slave_net_timeout= 10;
> >
> > === modified file 'mysql-test/suite/rpl/r/rpl_heartbeat_basic.result'
> > --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result 2010-03-16 19:23:55
> +0000
> > +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result 2010-09-27 16:34:13
> +0000
> > @@ -38,14 +38,14 @@ RESET SLAVE;
> > *** Warning if updated slave_net_timeout < slave_heartbeat_timeout ***
> > SET @@global.slave_net_timeout=FLOOR(SLAVE_HEARTBEAT_TIMEOUT)-1;
> > Warnings:
> > -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.
> > +Warning 1698 The 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.
> > SET @@global.slave_net_timeout=@restore_slave_net_timeout;
> > RESET SLAVE;
> >
> > *** Warning if updated slave_heartbeat_timeout > slave_net_timeout ***
> > CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT,
> MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=SLAVE_NET_TIMEOUT;
> > Warnings:
> > -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.
> > +Warning 1698 The 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.
> > RESET SLAVE;
> >
> > *** CHANGE MASTER statement only updates slave_heartbeat_period ***
> > @@ -140,7 +140,7 @@ Slave_heartbeat_period 0.001
> > RESET SLAVE;
> > CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT,
> MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.0009;
> > Warnings:
> > -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
> > +Warning 1697 The value for the heartbeat period is less than 1 milisecond. The
> period is reset to 0, meaning that heartbeating will effectively be disabled.
> > SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
> > Variable_name Value
> > Slave_heartbeat_period 0.000
> > @@ -149,19 +149,19 @@ RESET SLAVE;
> > *** Max slave_heartbeat_timeout ***
> > CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT,
> MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967;
> > Warnings:
> > -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.
> > +Warning 1698 The 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.
> > SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
> > Variable_name Value
> > Slave_heartbeat_period 4294967.000
> > RESET SLAVE;
> > CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT,
> MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294968;
> > -ERROR HY000: The requested value for the heartbeat period is negative or
> exceeds the maximum 4294967 seconds
> > +ERROR HY000: The requested value for the heartbeat period is either negative or
> exceeds the maximum allowed (4294967 seconds).
> > RESET SLAVE;
> > CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT,
> MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=8589935;
> > -ERROR HY000: The requested value for the heartbeat period is negative or
> exceeds the maximum 4294967 seconds
> > +ERROR HY000: The requested value for the heartbeat period is either negative or
> exceeds the maximum allowed (4294967 seconds).
> > RESET SLAVE;
> > CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT,
> MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967296;
> > -ERROR HY000: The requested value for the heartbeat period is negative or
> exceeds the maximum 4294967 seconds
> > +ERROR HY000: The requested value for the heartbeat period is either negative or
> exceeds the maximum allowed (4294967 seconds).
> > RESET SLAVE;
> >
> > *** Misc incorrect values ***
> >
> > === modified file 'sql/share/errmsg-utf8.txt'
> > --- a/sql/share/errmsg-utf8.txt 2010-06-07 08:47:04 +0000
> > +++ b/sql/share/errmsg-utf8.txt 2010-09-27 16:34:13 +0000
> > @@ -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"
> > @@ -6346,3 +6346,9 @@ ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_L
> > ER_FAILED_READ_FROM_PAR_FILE
> > eng "Failed to read from the .par file"
> > swe "Misslyckades läsa från .par filen"
> > +
> > +ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN
> > + eng "The value for the heartbeat period is less than 1 milisecond. The period
> is reset to 0, meaning that heartbeating will effectively be disabled."
> > +
> > +ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX
> > + eng "The 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."
> >
> > === modified file 'sql/sql_yacc.yy'
> > --- a/sql/sql_yacc.yy 2010-09-01 13:12:42 +0000
> > +++ b/sql/sql_yacc.yy 2010-09-27 16:34:13 +0000
> > @@ -1935,32 +1935,25 @@ master_def:
> > 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);
> > + 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;
> >
> > === modified file 'sql/sys_vars.cc'
> > --- a/sql/sys_vars.cc 2010-08-30 14:07:40 +0000
> > +++ b/sql/sys_vars.cc 2010-09-27 16:34:13 +0000
> > @@ -2935,11 +2935,8 @@ static bool fix_slave_net_timeout(sys_va
> > (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;
> > }
--
Luís