Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected Result when using IS NOT NULL #15265

Closed
suyZhong opened this issue Dec 24, 2023 · 1 comment · Fixed by #15280
Closed

Unexpected Result when using IS NOT NULL #15265

suyZhong opened this issue Dec 24, 2023 · 1 comment · Fixed by #15280
Assignees
Labels
bug Clear identification of incorrect behaviour

Comments

@suyZhong
Copy link

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

@suyZhong suyZhong added the triage An issue that needs to be triaged by a maintainer label Dec 24, 2023
@jeeminso
Copy link
Contributor

Thank you a lot for reporting @suyZhong 👍

@jeeminso jeeminso added bug Clear identification of incorrect behaviour and removed triage An issue that needs to be triaged by a maintainer labels Dec 25, 2023
@jeeminso jeeminso self-assigned this Jan 3, 2024
@mergify mergify bot closed this as completed in #15280 Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Clear identification of incorrect behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants