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

Hybrid functions do not add CURRENT_DATE when converting TIME to DATETIME

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.0.10
    • Fix Version/s: 10.0.12
    • Component/s: None
    • Labels:

      Description

      Hybrid functions IF, IFNULL,CASE,COALESCE do not add
      CURRENT_TIME when converting TIME to DATETIME:

      mysql> SELECT IF(1,TIME'10:10:10',DATE'2001-01-01');
      +---------------------------------------+
      | IF(1,TIME'10:10:10',DATE'2001-01-01') |
      +---------------------------------------+
      | 0000-00-00 10:10:10                   |
      +---------------------------------------+
      1 row in set (0.01 sec)
      

      MySQL-5.6 correctly adds CURRENT_DATE:

      +---------------------------------------+
      | IF(1,TIME'10:10:10',DATE'2001-01-01') |
      +---------------------------------------+
      | 2014-04-15 10:10:10                   |
      +---------------------------------------+
      1 row in set (0.00 sec)
      

        Gliffy Diagrams

          Attachments

            Issue Links

              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: