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

Wrong warning for CAST(TIME('10:20:30') AS DATE) + INTERVAL 1 DAY

    Details

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

      Description

      A confusing warning is printed in the following SQL script:

      mysql> select CAST(TIME('10:20:30') AS DATE) + INTERVAL 1 DAY; show warnings;
      +-------------------------------------------------+
      | CAST(TIME('10:20:30') AS DATE) + INTERVAL 1 DAY |
      +-------------------------------------------------+
      | NULL                                            |
      +-------------------------------------------------+
      1 row in set, 1 warning (0.00 sec)
      
      +---------+------+----------------------------------------------+
      | Level   | Code | Message                                      |
      +---------+------+----------------------------------------------+
      | Warning | 1292 | Truncated incorrect date value: '0000-00-00' |
      +---------+------+----------------------------------------------+
      1 row in set (0.00 sec)
      

      The word "Truncated" is not appropriate here.

      The expected warning is something like:
      "Incorrect datetime value: '0000-00:00 00:00:00'"
      or
      "Incorrect date value: '0000-00:00".

      A warning generated in MySQL-5.1 and 5.5 is also not perfect:
      Incorrect datetime value: '10:20:30'
      But at least does not contain the confusing word "Truncated".

        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: