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

Wrong result (OFFSET is ignored) with DISTINCT

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
    • 10.5, 10.6, 10.11
    • Server

    Description

      CREATE TABLE t1 (a int) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (1);
       
      CREATE TABLE t2 (b int) ENGINE=MyISAM;
      INSERT INTO t2 VALUES (1),(2),(3);
       
      SELECT DISTINCT t1.a FROM t1 JOIN t2 ORDER BY a LIMIT 10 OFFSET 10;
       
      # Cleanup
      DROP TABLE t1, t2;
      

      10.5 eeb8ebb1

      SELECT DISTINCT t1.a FROM t1 JOIN t2 ORDER BY a LIMIT 10 OFFSET 10;
      a
      1
      

      The expected result is an empty set.

      The failure started happening after this commit in 10.5.0:

      commit eb0804ef5e7eeb059bb193c3c6787e8a4188d34d
      Author: Oleksandr Byelkin
      Date:   Thu Sep 26 09:49:50 2019 +0200
       
          MDEV-18553: MDEV-16327 pre-requisits part 1: isolation of LIMIT/OFFSET handling
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            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.