pingcap / pingcap/tidb

TiFlash cast double as date behaves differently with tidb for unnormal cases

Open
#57,725 4 comments 0 reactions 0 assignees View on GitHub
affects-8.4 severity/minor 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)
prepare data
```sql
DROP table if exists v1;
DROP table if exists v2;
CREATE TABLE v1 (c0 DOUBLE);
CREATE TABLE v2 (c0 TEXT(232));

INSERT IGNORE INTO v2 VALUES ('B');
INSERT INTO v1 VALUES (0.4813424496784843), (0.8955355849595229);
ALTER TABLE v2 SET TIFLASH REPLICA 1;
ALTER TABLE v1 SET TIFLASH REPLICA 1;
```
execute query
```sql
SELECT /*+ read_from_storage(tikv[v1]) */ v1.c0, v2.c0 FROM v1 INNER JOIN v2 ON (v2.c0 NOT REGEXP ((CAST(v1.c0 AS DATE))));
SELECT /*+ read_from_storage(tiflash[v1]) */ v1.c0, v2.c0 FROM v1 INNER JOIN v2 ON (v2.c0 NOT REGEXP ((CAST(v1.c0 AS DATE))));
```

### 2. What did you expect to see? (Required)
The results of the two queries are equal.

### 3. What did you see instead (Required)
Query1 result:
```
0.4813424496784843,B
```

Query2 result:
```
0.4813424496784843,B
0.8955355849595229,B
```
### 4. What is your TiDB version? (Required)

Release Version: v8.4.0
Edition: Community
Git Commit Hash: 1a9f0fa25580907d3266dc3edf000ba24379a600
Git Branch: HEAD
UTC Build Time: 2024-11-07 15:18:43
GoVersion: go1.23.2
Race Enabled: false
Check Table Before Drop: false
Store: tikv

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.