unexpected warning: Division by 0
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
### 1. Minimal reproduce step (Required)
```
drop table t1 ,t2;
create table t1(a decimal(20,4));
create table t2(a decimal(20,4));
insert into t1 values(0.0001),(-0.0001),(0);
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t2 values(0.0001),(-0.0001),(0);
insert into t2 select * from t2;
-- 可能需要多次执行
explain analyze select case when t1.a<=0 then null else t2.a/t1.a end aaaa from t1,t2;
```
### 2. What did you expect to see? (Required)
Query success and no warning.
### 3. What did you see instead (Required)
Many `warning: Division by 0`, although query success.
### 4. What is your TiDB version? (Required)
nightly
Contributor guide
Assessment
This issue has not been assessed yet.