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

IN clause not properly evaluated in where

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.6
    • Fix Version/s: 1.5.1, 1.4.4
    • Component/s: MariaDB Server
    • Labels:
      None
    • Environment:
      debian9
    • Sprint:
      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

            Assignee:
            dleeyh Daniel Lee
            Reporter:
            alebacq antoine
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: