Different div precision between tidb and tiflash
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
create table t(id int, num decimal);
insert into t values(1,100);
alter table t set tiflash replica 1;
select /*+ read_from_storage(tikv[t]) */ length(sum(num)/10) from t group by id;
select /*+ read_from_storage(tiflash[t]) */ length(sum(num)/10) from t group by id;
```
### 2. What did you expect to see? (Required)
The div result in tidb has the same length with tiflash.
### 3. What did you see instead (Required)
```
mysql> select /*+ read_from_storage(tikv[t]) */ length(sum(num)/10) from t group by id;
+---------------------+
| length(sum(num)/10) |
+---------------------+
| 12 |
+---------------------+
1 row in set (0.00 sec)
mysql> select /*+ read_from_storage(tiflash[t]) */ length(sum(num)/10) from t group by id;
+---------------------+
| length(sum(num)/10) |
+---------------------+
| 7 |
+---------------------+
1 row in set (0.04 sec)
mysql> select /*+ read_from_storage(tikv[t]) */ sum(num)/10 from t group by id union select /*+ read_from_storage(tiflash[t]) */ sum(num)/10 from t group by id;
+-------------+
| sum(num)/10 |
+-------------+
| 10.0000 |
| 10.0000 |
+-------------+
2 rows in set (0.02 sec)
```
### 4. What is your TiDB version? (Required)
v7.1.5, master
Contributor guide
Assessment
This issue has not been assessed yet.