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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.13
    • Fix Version/s: 10.0.15
    • Component/s: Temporal Types
    • Labels:
      None

      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'.

        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:
                  Resolved: