pingcap / pingcap/tidb

Incorrect result for CONV with NULL parameters

Open
#64,094 0 comments 0 reactions 0 assignees View on GitHub
contribution sig/execution type/bug
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
DROP TABLE t1;
CREATE TABLE IF NOT EXISTS t1 (c1 SMALLINT UNSIGNED);
INSERT INTO t1 VALUES (23);
SELECT CONV(c1, c1, TRUNCATE(c1, NULL)) FROM t1; -- actual:{23}, expected:{NULL}
```
### 2. What did you expect to see? (Required)
NULL value should be returned.
### 3. What did you see instead (Required)
23 was returned.
### 4. What is your TiDB version? (Required)

Release Version: v8.5.3
Edition: Community
Git Commit Hash: dc2548aac79a712265e831cff2a3a896bc0a5a38
Git Branch: HEAD
UTC Build Time: 2025-07-31 13:54:43
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.