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

LP:992405 - Wrong result when using SQL_BUFFER_RESULT if min/max loose scan is chosen

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      The following sequence of commands brings us to a wrong result in MariaDB 5.2 :

      CREATE TABLE t1 (a int, b varchar(1), KEY (b,a) );
      INSERT INTO t1 VALUES (1,NULL),(0,'a');
      SINSERT INTO t1 VALUES (2,'x'),(0,'y');
      SELECT SQL_BUFFER_RESULT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b;

      MariaDB [test]> SELECT SQL_BUFFER_RESULT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b;
      ------------+

      MIN(a) b

      ------------+

      NULL NULL

      ------------+

      The result is correct without the modifier SQL_BUFFER_RESULT:

      MariaDB [test]> SELECT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b;
      ------------+

      MIN(a) b

      ------------+

      0 a

      ------------+

      (See also bug #12640437 for mysql-5.6)

      Attachments

        Issue Links

          Activity

            People

              timour Timour Katchaounov (Inactive)
              igor Igor Babaev
              Votes:
              0 Vote for this issue
              Watchers:
              0 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.