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

DATE(COALESCE(year_column)) returns a wrong result

    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

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: