Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5467

TO_DAYS(DATE(TIME('32 00:00:00'))) returns a wrong result

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.3.12
    • Fix Version/s: 5.3.13
    • Component/s: None
    • Labels:
      None

      Description

      mysql> select to_days('0000-01-01'), date(time('32 00:00:00')),to_days(date(time('32 00:00:00')));
      +-----------------------+---------------------------+------------------------------------+
      | to_days('0000-01-01') | date(time('32 00:00:00')) | to_days(date(time('32 00:00:00'))) |
      +-----------------------+---------------------------+------------------------------------+
      |                     1 | 0000-01-01                |                               NULL |
      +-----------------------+---------------------------+------------------------------------+
      1 row in set, 1 warning (0.00 sec)
      
      mysql> show warnings;
      +---------+------+---------------------------------------+
      | Level   | Code | Message                               |
      +---------+------+---------------------------------------+
      | Warning | 1292 | Incorrect datetime value: '768:00:00' |
      +---------+------+---------------------------------------+
      1 row in set (0.00 sec)
      

      The expected result for the third column is 1, without warnings.

      Or the other way around, date(time('32 00:00:00')) should return NULL.

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: