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

Bad warning for DATE_ADD(timestamp_column, INTERVAL 10 SECOND)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.17, 10.1.3, 5.5.42
    • Fix Version/s: 10.1.4
    • Component/s: Temporal Types
    • Labels:
      None

      Description

      This script:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a TIMESTAMP);
      INSERT INTO t1 VALUES ('0000-00-00 00:00:00');
      SELECT DATE_ADD(a, INTERVAL 10 SECOND) FROM t1;
      SHOW WARNINGS;
      

      returns:

      +---------+------+----------------------------------------+
      | Level   | Code | Message                                |
      +---------+------+----------------------------------------+
      | Warning | 1292 | Incorrect datetime value: '0000-00-00' |
      +---------+------+----------------------------------------+
      

      The expected warning would be:

      Incorrect datetime value: '0000-00-00 00:00:00'
      

        Gliffy Diagrams

          Attachments

            Issue Links

              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:
                    Resolved: