Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-2096

IN clause not properly evaluated in where

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.6
    • 1.4.4, 1.5.1
    • MariaDB Server
    • None
    • debian9
    • 2020-2, 2020-3, 2020-4, 2020-5, 2020-6, 2020-7

    Description

      IN() clause does not evaluate properly on some columns with a window function

      in the example below, the column r is computed with the function DENSE_RANK in a subselect, and there is a where r in (...). The where clause does not filter rows as expected.

      Note that rows are properly filtered if the where clause is rewritten as (r=1 or r=2)

      create table t(a int, b int) engine=ColumnStore;
      insert into t(a,b) values(1,4),(2,3),(3,2),(4,1);

      select
      a,
      r
      from (
      select
      a,
      DENSE_RANK() OVER `w_0` as `r`
      from t
      WINDOW `w_0` as ( ORDER BY `b` DESC)
      ) t0
      where r in (1,2)

      => returns
      1,1
      2,2
      3,3
      4,4

      instead of just the first 2 rows

      Attachments

        Activity

          People

            dleeyh Daniel Lee (Inactive)
            alebacq antoine
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.