Skip to content

Unexpected Results by RIGHT JOIN #38654

@bajinsheng

Description

@bajinsheng

Bug Report

1. Minimal reproduce step (Required)

CREATE TABLE t0(c0 INT);
CREATE TABLE t1(c0 INT);
INSERT INTO t1 VALUES (1);

SELECT * FROM t0 RIGHT JOIN t1 ON t0.c0; -- {NULL|1}
SELECT ((NOT ('i'))AND(t0.c0)) IS NULL FROM  t0 RIGHT JOIN t1 ON t0.c0; -- {1}
SELECT * FROM t0 RIGHT JOIN t1 ON t0.c0 WHERE ((NOT ('i'))AND(t0.c0)) IS NULL; -- empty set

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

SELECT * FROM t0 RIGHT JOIN t1 ON t0.c0; returns non-empty result and ((NOT ('i'))AND(t0.c0)) IS NULL is evaluated to true in the second SELECT, but the third SELECT returns empty result.

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

| Release Version: v6.4.0-alpha-133-g6c55faf03
Edition: Community
Git Commit Hash: 6c55faf034e8c205ffd23126829c637fb8a47451
Git Branch: master
UTC Build Time: 2022-10-26 07:47:53
GoVersion: go1.19.1
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: true
Store: unistore |

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions