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

A self-join over an OR-filtered derived table computes MAX() OVER(PARTITION BY ...) as 2,3,3 instead of 3,3,3

    XMLWordPrintable

Details

    Description

      the OR predicate keeps all rows `1,2,3`, so every output partition should report `MAX(subq0.c1)=3`. MariaDB instead returns the multiset `

      {2 x 1, 3 x 2}`.


      CREATE TABLE t3(c0 INT NOT NULL);

      INSERT INTO t3 VALUES (1), (2), (3);

      SELECT MAX(subq0.c1) OVER (PARTITION BY t3.c0)
      FROM t3
      INNER JOIN (
      SELECT t3.c0 AS c1
      FROM t3
      WHERE ((t3.c0 > (-t3.c0)) OR (t3.c0 > 0))
      ) AS subq0
      ON (t3.c0 < subq0.c1); – Expected correct multiset: {3 x 3} – actual Wrong multiset: {2 x 1, 3 x 2}

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              yx yx
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.