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

MIN(timestamp) returns wrong result for near-zero times

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
    • 10.4, 10.5, 10.6
    • Temporal Types
    • None

    Description

      For timestamps in (0,1) second interval (less than a second since the epoch) MIN returns zero.

      SET time_zone='+00:00';
       
      CREATE TABLE t1 (a TIMESTAMP(1));
      INSERT INTO t1 VALUES ('1970-01-01 00:00:00.1'),('1970-01-01 00:00:00.9');
       
      SELECT a FROM t1;
      SELECT MIN(a) FROM t1;
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 c03841ec

      SELECT a FROM t1;
      a
      1970-01-01 00:00:00.1
      1970-01-01 00:00:00.9
      SELECT MIN(a) FROM t1;
      MIN(a)
      0000-00-00 00:00:00.0
      

      The problem was introduced in 10.4.1 by this commit:

      commit 34eb98387f8f46a80fb053081dbe20d415f23b39 (HEAD)
      Author: Alexander Barkov
      Date:   Sat Dec 8 19:39:23 2018 +0400
       
          MDEV-13995 MAX(timestamp) returns a wrong result near DST change
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.