TiFlash cannot execute normally when using ELT function
- 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 t0(c1 DATE, PRIMARY KEY(c1));
INSERT IGNORE INTO t0 VALUES ('8397-05-16');
ALTER TABLE t0 SET TIFLASH REPLICA 1;
SELECT /*+ read_from_storage(tiflash[t0]) */ *
FROM t0
WHERE ELT(CAST('-392983269' AS UNSIGNED), (('') <= (c1)));
```
### 2. What did you expect to see? (Required)
Tiflash should execute normally.
### 3. What did you see instead (Required)
Tiflash is stuck.
```sql
mysql> explain SELECT /*+ read_from_storage(tiflash[t0]) */ * FROM t0 WHERE ELT(CAST('-392983269' AS UNSIGNED), (('') <= (c1)));
+----------------------------+---------+--------------+---------------+-----------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+----------------------------+---------+--------------+---------------+-----------------------------------------------------------------------------+
| TableReader_13 | 0.80 | root | | MppVersion: 2, data:ExchangeSender_12 |
| └─ExchangeSender_12 | 0.80 | mpp[tiflash] | | ExchangeType: PassThrough |
| └─Selection_11 | 0.80 | mpp[tiflash] | | elt(18446744073316568347, cast(le(NULL, test.t0.c1), var_string(20))) |
| └─TableFullScan_10 | 1.00 | mpp[tiflash] | table:t0 | pushed down filter:empty, keep order:false, stats:partial[c1:unInitialized] |
+----------------------------+---------+--------------+---------------+-----------------------------------------------------------------------------+
4 rows in set, 2 warnings (0.05 sec)
```
### 4. What is your TiDB version? (Required)
Release Version: v8.5.0
Contributor guide
Assessment
This issue has not been assessed yet.