Skip to content

Unexpected result when using IS DISTINCT FROM in VIEW #7563

Description

@suyZhong

Describe the bug

Consider the following test case. The third query should return an empty result set since the second query shows that the expression should be evaluated to null.

Reproduction steps

DROP TABLE IF EXISTS t1 CASCADE;

CREATE  TABLE  t1(c1 VARCHAR(500));
INSERT INTO t1(c1) VALUES ('a');
CREATE VIEW v0(c0) AS SELECT ('a'||NULL) FROM t1;

SELECT * FROM v0; -- null
SELECT ((v0.c0 IS NOT DISTINCT FROM v0.c0) AND (v0.c0 = v0.c0)) FROM v0; -- null
SELECT * FROM v0 WHERE ((v0.c0 IS NOT DISTINCT FROM v0.c0) AND (v0.c0 = v0.c0));
-- Expected: empty result set
-- Actual: null

Expected behavior

Empty result.

MonetDB release

v11.52.0 (hg id: 0d891eb)

Executables source

Self compiled and installed

Operating System

Ubuntu 22.04

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions