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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.0.3
    • 10.2(EOL)
    • None
    • 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

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

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.