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

Conversion of TIME to DATETIME works differently in MariaDB and MySQL

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 10.0.4
    • 10.0.5
    • None
    • None

    Description

      I haven't found this one among filed bugs, maybe it was just put in a different way; please feel free to close as a duplicate if so

      There was a change in MySQL 5.6.4:

      TIME values are converted to DATETIME by adding the time to the current date. (This means that the date part of the result differs from the current date if the time value is outside the range from '00:00:00' to '23:59:59'.) Previously, conversion of TIME values to DATETIME was unreliable.

      It works in MySQL 5.6, but not in MariaDB 10.0.4 candidate:

      MySQL [test]> select cast(current_time() as datetime);
      +----------------------------------+
      | cast(current_time() as datetime) |
      +----------------------------------+
      | 2013-08-10 14:19:15              |
      +----------------------------------+
      1 row in set (0.00 sec)
       
      MySQL [test]> select @@version;
      +-----------+
      | @@version |
      +-----------+
      | 5.6.10    |
      +-----------+

      MariaDB [test]> select cast(current_time() as datetime);
      +----------------------------------+
      | cast(current_time() as datetime) |
      +----------------------------------+
      | 0000-00-00 14:19:24              |
      +----------------------------------+
      1 row in set (0.00 sec)
       
      MariaDB [test]> select @@version;
      +----------------------+
      | @@version            |
      +----------------------+
      | 10.0.3-MariaDB-debug |
      +----------------------+

      Attachments

        Activity

          People

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