pingcap / pingcap/tidb

TiFlash cannot execute normally when using ELT function

Open
#59,480 2 comments 0 reactions 0 assignees View on GitHub
affects-8.5 may-affects-5.4 may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 severity/major 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
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

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.