Skip to content

Unexpected result for INNER JOIN with IS NOT NULL #7426

Description

@suyZhong

Describe the bug

Consider the test cases below. It is unexpected that the third query returns empty result, since the second query returns true, which means that the WHERE clause in the third query should be evaluated to true and thus return the row in the table.

To Reproduce

CREATE TABLE t1(c1 INTEGER);
CREATE TABLE t0(c0 BOOL, c1 INTEGER);
INSERT INTO t1 (c1) VALUES (0);
CREATE UNIQUE INDEX i0 ON t0(c1 , c0 );
INSERT INTO t0 (c0, c1) VALUES (true, 0);

SELECT t0.c0, t0.c1, t1.c1 FROM t1 INNER  JOIN t0 ON t0.c0; -- true 0 0

SELECT (t0.c1) IS NOT NULL FROM t1 INNER  JOIN t0 ON t0.c0; -- true
SELECT t0.c0, t0.c1, t1.c1 FROM t1 INNER  JOIN t0 ON t0.c0 WHERE (t0.c1) IS NOT NULL; 
-- Expected: true 0 0
-- Actual: Empty Result

Expected behavior
The result of the third query should be same as the first one

Software versions

  • MonetDB v11.49.1 (Dec2023).
  • OS and version: Docker on Ubuntu 22.04
  • Installed from latest docker image

**Issue labeling **
Bug

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions