pingcap / pingcap/tidb

Inconsistent query results for the same value in a GENERATED column

Open
#44,135 5 comments 0 reactions 1 assignee Claimed by @xhebox View on GitHub
affects-8.1 affects-8.5 component/coprocessor may-affects-5.4 may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 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)

case 1
```SQL
CREATE TABLE t0(`c0` float GENERATED ALWAYS AS (`c1`), `c1` float);
INSERT INTO t0(c1) VALUES (0.5822439);
SELECT * FROM t0 WHERE (~ (CAST(c0 AS DATETIME)));
```
case 2
```SQL
CREATE TABLE t0(`c1` float);
INSERT INTO t0(c1) VALUES (0.5822439);
SELECT * FROM t0 WHERE (~ (CAST(c1 AS DATETIME)));
```
### 2. What did you expect to see? (Required)
case 1 and case 2 should return the same result.
### 3. What did you see instead (Required)
case 1 returns nothing, while case 2 returns the value 0.5822439.
### 4. What is your TiDB version? (Required)

Release Version: v7.0.0
Edition: Community
Git Commit Hash: 7376954cd868dbc44fc3015c9ef89c53749339a7
Git Branch: heads/refs/tags/v7.0.0
UTC Build Time: 2023-03-29 13:32:13
GoVersion: go1.20.2
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
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.