Incorrect Parameter Count Error in TIDB with NULLIF Clause
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
### 1. Minimal reproduce step (Required)
```sql
mysql> CREATE TABLE t0 (c0 BIT, c1 TINYINT);
mysql> SELECT (NULLIF(t0.c0, t0.c1)) FROM t0 WHERE ((NULLIF(t0.c0, t0.c1)) IN (-1245124291, -2048367048));
ERROR 1582 (42000): Incorrect parameter count in the call to native function 'in'
```
### 2. What did you expect to see? (Required)
There is an issue when executing an SQL query involving the NULLIF function combined with the IN clause in TIDB.
The query results in an “Incorrect parameter count” error, while the same query executes without issues in MySQL. So I think this might be a possible bug.
### 3. What did you see instead (Required)
See above.
### 4. What is your TiDB version? (Required)
```
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.2.0
Edition: Community
Git Commit Hash: 821e491a20fbab36604b36b647b5bae26a2c1418
Git Branch: HEAD
UTC Build Time: 2024-07-05 09:17:02
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.03 sec)
```
Contributor guide
Assessment
This issue has not been assessed yet.