Skip to content

Unexpected result when Concatenating NULL #15202

Closed

Description

@suyZhong

CrateDB version

CrateDB 5.6.0-SNAPSHOT built 76e7ee0

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 a non-empty result, which is surprising, given that the result of second query is NULL. The value of the expression should be NULL, and thus the third query should return an empty result.

I built crate myself and run it in docker container, here's the version: CrateDB 5.6.0-SNAPSHOT (built 76e7ee0/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.1)

Steps to Reproduce

CREATE TABLE t1(c0 INTEGER);
INSERT INTO t1 (c0) VALUES (NULL);
REFRESH TABLE t1;

SELECT * FROM t1; -- NULL
SELECT t1.c0!=(1||t1.c0) FROM t1; -- NULL
SELECT * FROM t1 WHERE (t1.c0!=(1||t1.c0)); 
-- Expected: Empty
-- Actual: NULL

Actual Result

NULL

Expected Result

empty table

Activity

  1. added
    triageAn issue that needs to be triaged by a maintainer
    on Dec 16, 2023
  2. added
    bugClear identification of incorrect behaviour
    and removed
    triageAn issue that needs to be triaged by a maintainer
    on Dec 20, 2023
  3. self-assigned this
    on Dec 20, 2023
  4. jeeminso commented on Dec 21, 2023

    @jeeminso
    Contributor

    Thank you a lot for reporting bugs from master branch. This is fixed by #15229.

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