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

Cursor protocol returns wrong result for 'SELECT MIN(b)-a' where 'a' and 'b' have TIMESTAMP datatype

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4(EOL), 10.5, 10.6, 10.9(EOL), 10.10(EOL), 11.0(EOL), 11.1(EOL), 11.2(EOL)
    • 10.5, 10.6
    • None
    • None

    Description

      Testcase (run MTR test with --cursor-protocol):

      CREATE  TABLE t1 (a TIMESTAMP(4), b TIMESTAMP DEFAULT 0) ENGINE=MyISAM;
      INSERT IGNORE INTO t1 (a) VALUES ('2001-01-01'),('2003-01-01');
      SELECT MIN(b)-a FROM t1;
      SELECT (SELECT MIN(b) FROM t1) - a FROM t1;
      DROP TABLE t1;
      

      Expected result:

      SELECT MIN(b)-a FROM t1;
      MIN(b)-a
      -20010101000000.0000
      SELECT (SELECT MIN(b) FROM t1) - a FROM t1;
      (SELECT MIN(b) FROM t1) - a
      -20010101000000.0000
      -20030101000000.0000
      

      Actual result:

      SELECT MIN(b)-a FROM t1;
      MIN(b)-a
      0.0000
      SELECT (SELECT MIN(b) FROM t1) - a FROM t1;
      (SELECT MIN(b) FROM t1) - a
      0.0000
      0.0000
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.