pingcap / pingcap/tidb

Internal Error of PI() DIV FLOOR() Expression

Open
#60,610 1 comment 0 reactions 0 assignees View on GitHub
severity/moderate sig/execution type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

### 1. Minimal reproduce step (Required)

```sql
CREATE TABLE t0(c1 BLOB(24));

INSERT IGNORE INTO t0 VALUES ('-1e500');

SELECT *
FROM t0
WHERE ((((PI()) DIV (FLOOR(t0.c1)))));

```

### 2. What did you expect to see? (Required)
Produce empty result same as MySQL

### 3. What did you see instead (Required)
```
[HY000][1105] [components/ tidb_query_datatype/ src/ codec/ mysql/ decimal. rs:1916]: parsing -179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 will overflow
```

### 4. What is your TiDB version? (Required)

```
Release Version: v9.0.0-beta.1.pre-547-g4d34cac87c
Edition: Community
Git Commit Hash: 4d34cac87c4f78db4a11bccc97c2f601219d1b9f
Git Branch: HEAD
UTC Build Time: 2025-04-11 05:02:15
GoVersion: go1.23.8
Race Enabled: false
Check Table Before Drop: false
Store: tikv
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.