Skip to content

bug: or_filters get incorrectly result #18964

@zhyass

Description

@zhyass

Summary

After v1.2.805-nightly

root@localhost:8000/default/default> set enable_selector_executor=0;

set
  enable_selector_executor = 0

root@localhost:8000/default/default> select number from numbers(6) where number < 6 and number in (1, 3, 5);

select
  number
from
  numbers(6)
where
  number < 6
  and number in (1, 3, 5)

╭────────╮
│ number │
│ UInt64 │
├────────┤
│      0 │
│      1 │
│      2 │
│      3 │
│      4 │
│      5 │
╰────────╯
6 rows read in 0.049 sec. Processed 6 rows, 48 B (122.45 rows/s, 979 B/s)

root@localhost:8000/default/default> create table t(a int, b int, c bool);

create table t(a int, b int, c bool)

root@localhost:8000/default/default> insert into t values(1,1,false),(2,2,false),(3,3,false),(4,4,false),(5,5,false);

insert into
  t
values
(1, 1, false),
(2, 2, false),
(3, 3, false),
(4, 4, false),
(5, 5, false)

╭─────────────────────────╮
│ number of rows inserted │
│          UInt64         │
├─────────────────────────┤
│                       5 │
╰─────────────────────────╯
5 rows written in 0.099 sec. Processed 5 rows, 44 B (50.51 rows/s, 444 B/s)

root@localhost:8000/default/default> update t set c = true where a < 6 and b in (1, 3, 5);

update
  t
set
  c = true
where
  a < 6
  and b in (1, 3, 5)

╭────────────────────────╮
│ number of rows updated │
│         UInt64         │
├────────────────────────┤
│                      5 │
╰────────────────────────╯
5 rows written in 0.303 sec. Processed 5 rows, 44 B (16.5 rows/s, 145 B/s)

root@localhost:8000/default/default> select * from t where a < 6 and b in (1, 3, 5);

select
  *
from
  t
where
  a < 6
  and b in (1, 3, 5)

╭───────────────────────────────────────────────────────╮
│        a        │        b        │         c         │
│ Nullable(Int32) │ Nullable(Int32) │ Nullable(Boolean) │
├─────────────────┼─────────────────┼───────────────────┤
│               11 │ true              │
│               22 │ true              │
│               33 │ true              │
│               44 │ true              │
│               55 │ true              │
╰───────────────────────────────────────────────────────╯
5 rows read in 0.098 sec. Processed 5 rows, 44 B (51.02 rows/s, 448 B/s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions