Inconsistent evaluation TIME_FORMAT(INET_ATON(int))
- 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 t4166 (c1 INT1);
INSERT t4166 () VALUES (127);
INSERT t4166 () VALUES (-18);
SELECT * FROM t4166 WHERE ((92 AND TIME_FORMAT((INET_ATON(t4166.c1)), '05e1e7a')));
-- 127
SELECT SUM(count) FROM (SELECT (((92 AND TIME_FORMAT((INET_ATON(t4166.c1)), '05e1e7a')))) IS TRUE AS count FROM t4166) AS ta_norec;
-- 2
```
### 2. What did you expect to see? (Required)
The SELECT * query should return an empty set, and the SELECT SUM(count) query should return 0, OR the SELECT * query should return 2 rows, and the SELECT SUM(count) query should return 2.
### 3. What did you see instead (Required)
The SELECT * query incorrectly returned one row: 127.
The SELECT SUM(count) query incorrectly returned 2.
### 4. What is your TiDB version? (Required)
Release Version: v8.5.0-20251010-ec6b882
Edition: Community
Git Commit Hash: https://github.com/pingcap/tidb/commit/ec6b882d188f77c199907ba26843a872b8c5fd6d
Git Branch: heads/refs/tags/v8.5.0-20251010-ec6b882
UTC Build Time: 2025-10-10 10:21:51
GoVersion: go1.23.3
Race Enabled: false
Check Table Before Drop: false
Store: unistore
Contributor guide
Assessment
This issue has not been assessed yet.