Unexpected Result by FIELD Function
- 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(c0 INT);
CREATE TABLE t1(c0 BOOL);
INSERT t0 VALUES (0.1);
SELECT FIELD(t0.c0, t1.c0, 'a') IS TRUE FROM t0 LEFT JOIN t1 ON 1; -- {true}
SELECT t0.c0 FROM t0 LEFT OUTER JOIN t1 ON 1 WHERE FIELD(t0.c0, t1.c0, 'a'); -- empty set
```
### 2. What did you expect to see? (Required)
The expression `FIELD(t0.c0, t1.c0, 'a') IS TRUE` is evaluated to `true` for the first query, but the second query returns an empty result set.
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
```bash
| Release Version: v7.6.0-alpha-347-g598ccada40-dirty
Edition: Community
Git Commit Hash: 598ccada4065e4871bc5bce53a039cbb598a6d82
Git Branch: master
UTC Build Time: 2023-12-01 01:44:42
GoVersion: go1.21.0
Race Enabled: false
Check Table Before Drop: false
Store: unistore |
```
Contributor guide
Assessment
This issue has not been assessed yet.