Skip to content

Unexpected Results when Using Concat Operator #15083

Description

@suyZhong

CrateDB version

version: crate-5.6.0-2023-11-21-14-52-f951788

CrateDB setup information

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

Also could reproduce in 5.5.0

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 are some issues concerning the || operator.

Steps to Reproduce

CREATE TABLE t0(c0 INT);
INSERT INTO t0(c0) VALUES (NULL);

SELECT * FROM t0; -- NULL
SELECT NOT (c0||0) < -1 FROM t0; -- TRUE
SELECT * FROM t0 WHERE NOT (c0||0)<-1; 
-- Expected: NULL
-- Actual: Empty

Actual Result

Empty

Expected Result

NULL

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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