Skip to content

Unexpected results when using natural right join #7879

@suyZhong

Description

@suyZhong

Considering the test case below.

CREATE TABLE t0(c0 INT, c1 INT);
CREATE TABLE t1(c0 INT);

INSERT INTO t0(c0, c1) VALUES (1, 2);
INSERT INTO t1( c0) VALUES (3);

SELECT * FROM t0 NATURAL RIGHT JOIN t1; -- 3 <null>
SELECT (c0 IN (c0, c1)) FROM t0 NATURAL RIGHT JOIN t1; -- <true>
SELECT * FROM t0 NATURAL RIGHT JOIN t1 WHERE ((c0 IN (c0, c1))); 
-- Expected: 3 <null>
-- Actual: empty

The third SELECT returns an empty result, which is surprising: If the result of second query is true, the value of the IN expression should be true, and thus the third query should return the row of the JOIN , that is 3 <null>, same as the first query.

I found this in version 6.0.0.154 where I built from source code ab37234

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions