pingcap / pingcap/tidb

Inconsistent results while executing functionally equivalent queries

Open
#65,654 2 comments 0 reactions 0 assignees View on GitHub
contribution severity/moderate sig/planner 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(c0 BOOL ZEROFILL );
DELETE FROM t0 ORDER BY t0.c0 ASC;
INSERT IGNORE INTO t0 VALUES (false), (true) ON DUPLICATE KEY UPDATE c0=t0.c0;
REPLACE INTO t0(c0) VALUES (true);
UPDATE t0 SET c0=0.8975324002384114 WHERE t0.c0;
CREATE OR REPLACE VIEW v0(c0) AS SELECT PI() FROM t0 WHERE true;
ALTER TABLE t0 ENABLE KEYS;
INSERT INTO t0 VALUES (false);
REPLACE INTO t0(c0) VALUES (true), (true), (true);
ALTER TABLE t0 CHANGE c0 c0 BOOL NOT NULL ;
INSERT INTO t0 VALUES (false), (true), (NULL);
REPLACE INTO t0(c0) VALUES (NULL);
REPLACE INTO t0 VALUES (NULL), (false);
INSERT IGNORE INTO t0(c0) VALUES (true);
REPLACE INTO t0(c0) VALUES (false);
REPLACE INTO t0(c0) VALUES (false);
SELECT v0.c0 FROM v0, t0;
SELECT v0.c0 FROM v0, t0 WHERE '' UNION ALL SELECT v0.c0 FROM v0, t0 WHERE (NOT ('')) UNION ALL SELECT v0.c0 FROM v0, t0 WHERE (('') IS NULL);
```

### 2. What did you expect to see? (Required)
Queries return same result

### 3. What did you see instead (Required)
The first query return rows with value 3.141592653589793
The second query return rows with value 3.141593

### 4. What is your TiDB version? (Required)
8.0.11-TiDB-v9.0.0-beta.1.pre-640-g24903d6b24

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.