Query reports overflow in TiDB but not in MySQL
- 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)
```sql
CREATE TABLE t1(c0 DOUBLE DEFAULT -2.032393529E9 );
INSERT INTO t1(c0) VALUES (1.7976931348623157E90);
SELECT t1.c0 FROM t1 WHERE (CASE ((-208665085)REGEXP(CAST(0.6831809677297028 AS DECIMAL))) WHEN DEFAULT(t1.c0) THEN ((t1.c0) IS NULL) ELSE CAST(t1.c0 AS DECIMAL) END );
```
### 2. What did you expect to see? (Required)
```sql
+-----------------------+
| c0 |
+-----------------------+
| 1.7976931348623157e90 |
+-----------------------+
```
### 3. What did you see instead (Required)
```sql
ERROR 1105 (HY000): [components/tidb_query_datatype/src/codec/mysql/decimal.rs:1916]: parsing 1797693134862315700000000000000000000000000000000000000000000000000000000000000000000000000 will overflow
```
### 4. What is your TiDB version? (Required)
```sql
Release Version: v8.3.0-alpha-50-gb59f5ecb47-dirty
Edition: Community
Git Commit Hash: b59f5ecb472d831f867b079e0a409caef9f4a290
Git Branch: master
UTC Build Time: 2024-07-31 18:41:32
GoVersion: go1.22.5
Race Enabled: false
Check Table Before Drop: false
Store: tikv
```
Contributor guide
Assessment
This issue has not been assessed yet.