Skip to content

bug: incorrect domain op for decimal type #18916

@sundy-li

Description

@sundy-li

SQL

select 1> 0.45,  number, number::Decimal(15,2) t , t > 0.45 from numbers(10);

outputs:

╭───────────────────────────────────────────────╮
│ 1 > 0.45 │ number │        t       │ t > 0.45 │
│  Boolean │ UInt64 │ Decimal(15, 2) │  Boolean │
├──────────┼────────┼────────────────┼──────────┤
│ true     │      0 │           0.00 │ false    │
│ true     │      1 │           1.00 │ false    │
│ true     │      2 │           2.00 │ false    │
│ true     │      3 │           3.00 │ false    │
│ true     │      4 │           4.00 │ false    │
│ true     │      5 │           5.00 │ false    │
│ true     │      6 │           6.00 │ false    │
│ true     │      7 │           7.00 │ false    │
│ true     │      8 │           8.00 │ false    │
│ true     │      9 │           9.00 │ false    │
╰───────────────────────────────────────────────╯

t > 0.45 is folded into false which it incorrect.

Metadata

Metadata

Assignees

Labels

C-bugCategory: something isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions