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

Include a warning message for zero-value date when reading data from a table using date and time functions

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 10.11, 11.4, 11.8, 12.1
    • 10.6, 10.11, 11.4, 11.8, 12.1
    • None
    • None

    Description

      Include a warning message for zero-value date when reading data from a table using date and time functions

      12.1.2>CREATE OR REPLACE TABLE t1 (a DATE, b DATE);
      Query OK, 0 rows affected (0.103 sec)
       
      12.1.2>
      12.1.2>INSERT INTO t1 VALUES ("2003-12-15", "0000-00-00");
      Query OK, 1 row affected (0.008 sec)
       
      12.1.2>
      12.1.2>SELECT DATEDIFF(a,b) FROM t1;
      +---------------+
      | DATEDIFF(a,b) |
      +---------------+
      |          NULL |
      +---------------+
      1 row in set (0.000 sec)
       
      12.1.2>
      

      Server shows warning message for zero-value date when using date and time functions directly

      12.1.2>SELECT DATEDIFF("2003-12-15", "0000-00-00");
      +--------------------------------------+
      | DATEDIFF("2003-12-15", "0000-00-00") |
      +--------------------------------------+
      |                                 NULL |
      +--------------------------------------+
      1 row in set, 1 warning (0.000 sec)
       
      12.1.2>SHOW WARNINGS;
      +---------+------+----------------------------------------+
      | Level   | Code | Message                                |
      +---------+------+----------------------------------------+
      | Warning | 1292 | Incorrect datetime value: '0000-00-00' |
      +---------+------+----------------------------------------+
      1 row in set (0.000 sec)
       
      12.1.2>
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.