pingcap / pingcap/tidb

Wrong Result Return from Tiflash

Open
#57,499 1 comment 1 reaction 0 assignees View on GitHub
affects-8.4 component/tiflash impact/inconsistency severity/moderate 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 t (
a VARCHAR(255),
b VARCHAR(255)
);

INSERT INTO t VALUES ('-1.7E+308', '1.7E+308');

ALTER TABLE t SET TIFLASH REPLICA 1;

SELECT /*+ READ_FROM_STORAGE(TIKV[t])*/
CAST(a AS DOUBLE) * CAST(b AS DOUBLE) AS result_a_b
FROM t;

SELECT /*+ READ_FROM_STORAGE(TIFLASH[t])*/
CAST(a AS DOUBLE) * CAST(b AS DOUBLE) AS result_a_b
FROM t;
```

### 2. What did you expect to see? (Required)

The query should return the same result from two query hints, and i think it should not return zero.

### 3. What did you see instead (Required)

```sql
mysql> SELECT /*+ READ_FROM_STORAGE(TIFLASH[t])*/ CAST(a AS DOUBLE) * CAST(b AS DOUBLE) AS result_a_b FROM t;
+------------+
| result_a_b |
+------------+
| 0 |
+------------+
1 row in set (0.01 sec)

mysql> SELECT /*+ READ_FROM_STORAGE(TIKV[t])*/ CAST(a AS DOUBLE) * CAST(b AS DOUBLE) AS result_a_b FROM t;
ERROR 1690 (22003): DOUBLE value is out of range in '(cast(test1.t.a, double BINARY) * cast(test1.t.b, double BINARY))'
```

### 4. What is your TiDB version? (Required)

TiDB v8.4.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.