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

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

    Details

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

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: