# [Known Issues] decimal 类型的字段在 TiFlash 中查询报 tidb error 1105 Wrong precision  69

## Key Words

TiFlash、Wrong precision、decimal

## Description

表中有 decimal 类型的字段，通过 TiFlash 查询报错，tidb error 1105 Wrong precision: 69 或者是 128

## Root Cause

在 5.0.4 上复现了 `ERROR 1105 (HY000): DB::Exception: Wrong precision:69`，在 tiup nightly 正常，应该是 master 已经修了。两个的区别在于 5.0.4 是 cast(mul(Column#6, 10000000000), decimal(69,20) BINARY)>Column#8, nightly 是 cast(mul(Column#6, 10000000000), decimal(65,20) BINARY)>Column#8应该还是 tidb 下推到 tiflash 的时候 decimal 的类型推导问题。

由 [https://github.com/pingcap/tidb/pull/28466](https://github.com/pingcap/tidb/pull/28466) 修复。5.0.6 会显式阻止下推，可能会有性能损失。建议升级到 5.3.0 及以上版本，这些版本可以正常下推到 Tiflash。

## Diagnostic Steps

```sql
CREATE TABLE test.test (
`COL1` decimal(31, 16) DEFAULT NULL
);
ALTER TABLE test.test SET TIFLASH REPLICA 1;
insert into test.test values
(1.1),
(2.2),
(2.2),
(3.3),
(3.3),
(3.3),
(4.4),
(4.4),
(4.4),
(4.4),
(5.5),
(5.5),
(5.5),
(5.5),
(5.5);
set tidb_allow_mpp=1;set tidb_enforce_mpp=1; 
set tidb_isolation_read_engines='tiflash';
select COL1 / 1000 from test.test
union
select sum(col1) \* 10000000000
from test.test;
```

## Workaround

多次调整 SQL 去掉报错的算法/逻辑，在应用内实现去掉的逻辑。

## Resolution

升级到 5.0.6/5.1.4/5.2.2/5.3.0 及以上的版本。

## Affected Versions

5.3.0 以下