Skip to content

Unexpected Result when using IS NOT NULL #15265

Description

@suyZhong

CrateDB version

CrateDB 5.6.0-SNAPSHOT built b44a403

CrateDB setup information

Manual build following the instructions here: https://github.com/crate/crate/blob/master/devs/docs/basics.rst

Problem description

The third SELECT returns an empty result, which is surprising, given that the result of second query is TRUE. The value of the WHERE condition is TRUE, and thus the third query should return the row.

I built crate myself and run it in docker container, here's the version: CrateDB 5.6.0-SNAPSHOT (built b44a403/NA, Linux 5.15.0-67-generic amd64, OpenJDK 64-Bit Server VM 21.0.1+12-LTS). Things work well on the latest docker image (5.5.2)

Steps to Reproduce

CREATE TABLE t1( c1 BOOLEAN);
INSERT INTO t1 (c1) VALUES (NULL);
REFRESH TABLE t1;

SELECT * FROM t1;  -- NULL
SELECT (NOT ((t1.c1) IS NOT NULL)) FROM t1; -- TRUE
SELECT * FROM t1 WHERE (NOT ((t1.c1) IS NOT NULL)); 
-- Expected: NULL
-- Actual: empty table

Actual Result

empty table

Expected Result

NULL

Metadata

Metadata

Assignees

Labels

bugClear identification of incorrect behaviour

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions