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

DATE(COALESCE(year_column)) returns a wrong result

    XMLWordPrintable

Details

    Description

      CREATE OR REPLACE TABLE t1 (a YEAR);
      INSERT INTO t1 VALUES (NULL);
      SELECT COALESCE(a), DATE(COALESCE(a)) FROM t1;
      

      +-------------+-------------------+
      | COALESCE(a) | DATE(COALESCE(a)) |
      +-------------+-------------------+
      |        NULL | 0000-00-00        |
      +-------------+-------------------+
      

      The result for DATE(COALESCE(a)) is wrong. It should be NULL.

      Attachments

        Issue Links

          Activity

            People

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