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

Different warnings for TIME and TIME(N) when @@old_mode=zero_date_time_cast

    XMLWordPrintable

Details

    Description

      This script:

      SET @@old_mode=zero_date_time_cast;
      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a TIME,b TIME(1));
      INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
      SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
      SHOW WARNINGS;

      produces the following output:

      ...
      MariaDB [test]> SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
      +------------+------------+
      | TO_DAYS(a) | TO_DAYS(b) |
      +------------+------------+
      |       NULL |       NULL |
      +------------+------------+
      1 row in set, 1 warning (0.00 sec)
       
      MariaDB [test]> SHOW WARNINGS;
      +---------+------+--------------------------------------------+
      | Level   | Code | Message                                    |
      +---------+------+--------------------------------------------+
      | Warning | 1264 | Out of range value for column 'a' at row 1 |
      +---------+------+--------------------------------------------+
      1 row in set (0.00 sec)

      Notice, the warning was correctly displayed for the column 'a',
      but was not displayed for the column 'b'.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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