CrateDB version
CrateDB 5.7.0-SNAPSHOT built 93ee46e
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 expression should be TRUE, and thus the third query should return an empty result.
Steps to Reproduce
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(c1 BOOLEAN);
INSERT INTO t1 (c1) VALUES (null);
REFRESH TABLE t1;
SELECT * FROM t1; -- NULL
SELECT (NOT (NOT CONCAT_WS(true, CAST(t1.c1 AS BOOLEAN), true))) FROM t1; -- TRUE
SELECT * FROM t1 WHERE (NOT (NOT CONCAT_WS(true, CAST(t1.c1 AS BOOLEAN), true)));
-- Expected: NULL
-- Actual: empty result
-- For reference:
SELECT CAST(t1.c1 AS BOOLEAN) FROM t1; -- NULL
SELECT (NOT (NOT CONCAT_WS(true, NULL, true))) FROM t1; -- TRUE
SELECT * FROM t1 WHERE (NOT (NOT CONCAT_WS(true, null, true))); -- NULL
Actual Result
Empty
Expected Result
NULL
CrateDB version
CrateDB 5.7.0-SNAPSHOT built 93ee46e
CrateDB setup information
Manual build following the instructions here: https://github.com/crate/crate/blob/master/devs/docs/basics.rst
Problem description
The third
SELECTreturns an empty result, which is surprising, given that the result of second query isTRUE. The value of the expression should beTRUE, and thus the third query should return an empty result.Steps to Reproduce
Actual Result
Empty
Expected Result
NULL