Skip to content

Unexpected Results Using Boolean #15120

Description

@suyZhong

CrateDB version

5.6.0-SNAPSHOT built ff1e7f7

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 whole table.

I suppose there's some issue concerning boolean values comparison. Or another similar issue under NOT predicate?

Steps to Reproduce

CREATE TABLE t0(c1 INT,c2 INT);
INSERT INTO t0(c1) VALUES (1);

SELECT * FROM t0; -- 1 NULL
SELECT NOT (c1 OR c2)>true FROM t0; -- TRUE
SELECT * FROM t0 WHERE NOT (c1 OR c2)>true;
-- Expected: 1 NULL
-- Actual: empty table

Actual Result

empty table

Expected Result

1 NULL

Metadata

Metadata

Assignees

No one assigned

    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