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

Wrong warning when inserting zero date into TIMESTAMP with SQL_MODE=no_zero_date

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.5.36, 10.0.9
    • Fix Version/s: 10.0, 5.5
    • Component/s: None
    • Labels:
      None

      Description

      mysql> DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a DATE, b DATETIME, c TIMESTAMP); SET SQL_MODE='no_zero_date'; INSERT INTO t1 VALUES (0,0,0); SHOW WARNINGS;
      Query OK, 0 rows affected (0.05 sec)
      
      Query OK, 0 rows affected (0.21 sec)
      
      Query OK, 0 rows affected (0.00 sec)
      
      Query OK, 1 row affected, 3 warnings (0.00 sec)
      
      +---------+------+--------------------------------------------+
      | Level   | Code | Message                                    |
      +---------+------+--------------------------------------------+
      | Warning | 1264 | Out of range value for column 'a' at row 1 |
      | Warning | 1264 | Out of range value for column 'b' at row 1 |
      | Warning | 1265 | Data truncated for column 'c' at row 1     |
      +---------+------+--------------------------------------------+
      3 rows in set (0.00 sec)
      

      The warning for the TIMESTAMP column is wrong. Nothing was truncated.
      The correct warnings is 'Out of range...'

        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: