• unknown's avatar
    Fix for bug #33834: FRAC_SECOND: Applicability not clear in · 4f3eab58
    unknown authored
                        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.
    
    Additionally, the patch allows MICROSECOND to be used in TIMESTAMPADD/
    TIMESTAMPDIFF and marks FRAC_SECOND as deprecated.
    
    
    mysql-test/r/func_time.result:
      Added a test case for bug #33834.
    mysql-test/t/func_time.test:
      Added a test case for bug #33834.
    sql/sql_yacc.yy:
      Reject FRAC_SECOND for anything other than TIMESTAMPADD() or
      TIMESTAMPDIFF().
      Allow MICROSECOND to be used with TIMESTAMPADD()/TIMESTAMPDIFF().
      Warn about FRAC_SECOND being a deprecated unit.
    4f3eab58
sql_yacc.yy 266 KB