Hi!
On Feb 22, Alexey Kopytov wrote:
> ChangeSet@stripped, 2008-02-22 12:22:07+03:00, kaa@kaamos.(none) +3 -0
> Fix for bug #33834: FRAC_SECOND: Applicability not clear in
> documentation
>
> While the manual mentions FRAC_SECOND only for the TIMESTAMPADD()
> function, it was also possible to use FRAC_SECOND with DATE_ADD(),
> DATE_SUB() and +/- INTERVAL.
>
> Fixed the parser to match the manual, i.e. using FRAC_SECOND for
> anything other than TIMESTAMPADD()/TIMESTAMPDIFF() now produces a
> syntax error.
ok to push
with a couple of changes in comments, see below
> diff -Nrup a/sql/sql_yacc.yy b/sql/sql_yacc.yy
> --- a/sql/sql_yacc.yy 2008-02-01 11:00:39 +03:00
> +++ b/sql/sql_yacc.yy 2008-02-22 12:22:06 +03:00
> @@ -461,7 +461,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
> Currently there are 245 shift/reduce conflicts.
s/245/240/
or
s/245/<see the number below>/
> We should not introduce new conflicts any more.
> */
> -%expect 245
> +%expect 240
>
> %token END_OF_INPUT
>
> @@ -6005,21 +6007,28 @@ interval:
> | YEAR_MONTH_SYM { $$=INTERVAL_YEAR_MONTH; };
>
> +interval_time_stamp:
> + interval_time_st {}
> + | FRAC_SECOND_SYM {
> + $$=INTERVAL_MICROSECOND;
> + WARN_DEPRECATED("FRAC_SECOND", "MICROSECOND");
> + }
> + ;
add two comments please:
one above the WARN_DEPRECATED: explain that FRAC_SECOND was mistakenly
implemented with a wrong resolution, according to the ODBC standard
(where it comes from), it should be nanosecond, not microsecond. We
deprecate the incorrect implementation. But we don't plan to change it
to nanosecond, as it would mean changing TIMESTAMPADD and TIMESTAMPDIFF
to return DECIMAL as the return value will be too big for BIGINT.
and one on the same line as WARN_DEPRECATED: // will be removed in 6.2
when you'll merge it to 5.1, you'll notice that WARN_DEPRECATED got a
new argument there - a version where the feature will be removed. After
(or during) a merge you remove this end-of-line comment and put the
version into the macro.
Regards / Mit vielen Grüssen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Developer/Server Architect
/_/ /_/\_, /___/\___\_\___/ MySQL GmbH, Dachauer Str. 37, D-80335 München
<___/ Geschäftsführer: Kaj Arnö - HRB
München 162140