Skip to content

Unexpected Results #38310

@bajinsheng

Description

@bajinsheng

Bug Report

The predicate NOT (('4')AND(t0.c0<=>FALSE)) is evaluated FALSE, but the second SELECT still return non-empty result.

CREATE TABLE t0(c0 BOOL, PRIMARY KEY(c0));
CREATE TABLE t1(c0 INT);
INSERT INTO t0 VALUES (FALSE);
INSERT INTO t1 VALUES (1);

SELECT NOT (('4')AND(t0.c0<=>FALSE)) FROM t0; -- {0}
SELECT * FROM t0 WHERE NOT (('4')AND(t0.c0<=>FALSE)); -- {0}

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

The second SELECT returns empty set.

3. What did you see instead (Required)

The second SELECT returns one row.

4. What is your TiDB version? (Required)

| Release Version: v6.2.0-alpha-159-ge0527ba27
Edition: Community
Git Commit Hash: e0527ba
Git Branch: master
UTC Build Time: 2022-06-21 11:55:54
GoVersion: go1.18.3
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
Store: unistore |

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions