ClickHouse / ClickHouse/ClickHouse
Different behavior with dividing by 0 for Decimal and other types.
Open
comp-decimal
external
potential bug
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
**How to reproduce**
```
SELECT 1 / 0
┌─divide(1, 0)─┐
1. │ inf │
└──────────────┘
```
```
SELECT 1::Decimal(32, 18) / 0
Received exception:
Code: 153. DB::Exception: Division by zero: In scope SELECT CAST('1', 'Decimal(32, 18)') / 0. (ILLEGAL_DIVISION)
```
Clickhouse version: 24.7.1.2514
Example in fiddle:
https://fiddle.clickhouse.com/0cc20bd1-846b-4c1c-afbe-2933a0527cff
**Expected behavior**
Behavior must be equal. I think instead of error must be `inf`
Contributor guide
Assessment
This issue has not been assessed yet.