MariaDB Development
  1. MariaDB Development
  2. MDEV-4898

Too many warnings when inserting a bad value into a TIMESTAMP column

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.3
    • Fix Version/s: None
    • Labels:
      None
    • Global Rank:
      3466

      Description

      MariaDB [test]> drop table if exists t1; create table t1 (a timestamp); insert into t1 values (timestamp('2001-00-01 00:00:00.9999999')); show warnings; select * from t1;
      Query OK, 0 rows affected (0.07 sec)
      Query OK, 0 rows affected (0.19 sec)
      Query OK, 1 row affected, 3 warnings (0.04 sec)
      +---------+------+-------------------------------------------------------------------+
      | Level   | Code | Message                                                           |
      +---------+------+-------------------------------------------------------------------+
      | Warning | 1292 | Truncated incorrect datetime value: '2001-00-01 00:00:00.9999999' |
      | Warning | 1265 | Data truncated for column 'a' at row 1                            |
      | Warning | 1292 | Truncated incorrect datetime value: '2001-00-01 00:00:00.9999999' |
      +---------+------+-------------------------------------------------------------------+
      3 rows in set (0.00 sec)
      +---------------------+
      | a                   |
      +---------------------+
      | 0000-00-00 00:00:00 |
      +---------------------+
      1 row in set (0.00 sec)
      

      Notice two problems with the timestamp() parameter:

      • seven fractional digits
      • zero month

      There are three warnings generated, with two of them being equal.
      Looks too redundant. Either one or two warnings should be enough.

        Activity

        Hide
        Alexander Barkov added a comment -

        Versions 5.3 and 5.5 do not seem to be affected.

        Show
        Alexander Barkov added a comment - Versions 5.3 and 5.5 do not seem to be affected.

          People

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

            Dates

            • Created:
              Updated: