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

Microseconds do not work in INTERVAL definition, a value with a fractional part gets rounded

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 5.5.25
    • Fix Version/s: 5.5.27
    • Component/s: None
    • Labels:
      None

      Description

      I presume it also affects 5.3, but I didn't check.

      create table t1 (d datetime(6));
      insert into t1 values ('2012-12-12 00:00:00');
      update t1 set d = adddate(d, interval 1.5 second);
      select * from t1;

      MySQL 5.6 result:

      +----------------------------+
      | d                          |
      +----------------------------+
      | 2012-12-12 00:00:01.500000 |
      +----------------------------+

      MariaDB result:

      +----------------------------+
      | d                          |
      +----------------------------+
      | 2012-12-12 00:00:02.000000 |
      +----------------------------+

      I think that MySQL result is reasonable for a server which supports fractional seconds, although https://kb.askmonty.org/en/microseconds-in-mariadb/ does not explicitly specify that microseconds support is supposed to work in this case.

        Attachments

          Activity

            People

            Assignee:
            serg Sergei Golubchik
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: