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

Wrong result upon aggregate function with SQL_BUFFER_RESULT

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (pk INT PRIMARY KEY);
      INSERT INTO t1 VALUES (1),(2);
      CREATE TABLE t2 (a INT);
      INSERT INTO t2 VALUES (1),(2);
       
      SELECT SQL_BUFFER_RESULT MIN(pk) FROM t1, t2;
      SELECT MIN(pk) FROM t1, t2;
       
      DROP TABLE t1, t2;
      

      10.5 97c6cd97

      SELECT SQL_BUFFER_RESULT MIN(pk) FROM t1, t2;
      MIN(pk)
      NULL
      SELECT MIN(pk) FROM t1, t2;
      MIN(pk)
      1
      

      The problem appeared in 10.5(.15) after this commit:

      commit 38058c04a4fc021f381f8000e40ed23bd4fb8d75
      Commit:     Monty
      CommitDate: Tue Feb 8 14:32:29 2022 +0200
       
          MDEV-26585 Wrong query results when `using index for group-by`
      

      Attachments

        Activity

          People

            monty Michael Widenius
            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.