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

Comparison between TIME and DATETIME does not use CURRENT_DATE

    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

      This SQL script:

      SET timestamp=UNIX_TIMESTAMP('2014-04-14 10:20:30');
      SELECT CAST(TIME'10:20:30' AS DATETIME), TIME'10:20:30'=TIMESTAMP'2014-04-14 10:20:30' AS cmp;
      

      demonstrates that conversion between TIME and DATETIME
      does not add CURRENT_DATE to TIME.

      +----------------------------------+-----+
      | CAST(TIME'10:20:30' AS DATETIME) | cmp |
      +----------------------------------+-----+
      | 2014-04-14 10:20:30              |   0 |
      +----------------------------------+-----+
      

      MySQL-5.6 returns "1" in the "cmp" field in the same scenario.

        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: