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

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 5.5.25
    • 5.5.27
    • None
    • 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

            serg Sergei Golubchik
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.