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:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.25d
                  0.25d

                  Git Integration

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