Inconsistent evaluation of JSON_ARRAY() in WHERE clause between TiKV and TiFlash
- 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)
```
DROP TABLE IF EXISTS t0;
CREATE TABLE t0(c0 VARCHAR(48));
ALTER TABLE t0 SET TIFLASH REPLICA 1;
INSERT INTO t0(c0) VALUES ('7');
SELECT /*+ read_from_storage(tiflash[t0]) */ t0.c0 FROM t0 WHERE JSON_ARRAY(1840269109);
SELECT /*+ read_from_storage(tikv[t0]) */ t0.c0 FROM t0 WHERE JSON_ARRAY(1840269109);
```
### 2. What did you expect to see? (Required)
The same query returns the same results on both TiKV and TiFlash.
### 3. What did you see instead (Required)
```
mysql> SELECT /*+ read_from_storage(tiflash[t0]) */ t0.c0 FROM t0 WHERE JSON_ARRAY(1840269109);
Empty set (0.01 sec)
mysql> SELECT /*+ read_from_storage(tikv[t0]) */ t0.c0 FROM t0 WHERE JSON_ARRAY(1840269109);
+------+
| c0 |
+------+
| 7 |
+------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.5.0
Edition: Community
Git Commit Hash: d13e52ed6e22cc5789bed7c64c861578cd2ed55b
Git Branch: HEAD
UTC Build Time: 2024-12-18 02:26:06
GoVersion: go1.23.3
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Contributor guide
Assessment
This issue has not been assessed yet.