Skip to content

Unexpected Result when using IN  #15326

Closed

Description

@suyZhong

CrateDB version

CrateDB 5.6.0-SNAPSHOT built 5ff277c

CrateDB setup information

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

Problem description

Consider the test cases below. It is unexpected that the third query returns empty result, since the second query returns TRUE, which means that the WHERE clause in the third query should be evaluated to TRUE and thus return the row in the table.

Steps to Reproduce

DROP TABLE IF EXISTS t0;
CREATE TABLE t0(c0 VARCHAR, PRIMARY KEY(c0));
INSERT INTO t0 (c0) VALUES (true);
REFRESH TABLE t0;

SELECT * FROM t0; -- t
SELECT (t0.c0 IN (true)) FROM t0; -- TRUE
SELECT * FROM t0 WHERE (t0.c0 IN (true));
-- Expected: t
-- Actual:   empty result

Actual Result

Empty

Expected Result

t

Activity

  1. added
    triageAn issue that needs to be triaged by a maintainer
    on Jan 11, 2024
  2. self-assigned this
    on Jan 11, 2024
  3. added
    bugClear identification of incorrect behaviour
    and removed
    triageAn issue that needs to be triaged by a maintainer
    on Jan 11, 2024
  4. added 3 commits that reference this issue on Jan 16, 2024
    9a3eb3c
    54387ce
    7a51606
  5. added 2 commits that reference this issue on Jan 17, 2024
    1c52ae1
    27efd6d
  6. matriv commented on Jan 17, 2024

    @matriv
    Contributor

    Thx for reporting the issue @suyZhong, it has been fixed and will be available with the next hotfix release.

  7. added 5 commits that reference this issue on Jan 17, 2024
    5876b72
    7099d26
    a5f19f9
    2d7567f
    bc5de2f
  8. added a commit that references this issue on Jan 17, 2024
    c4984a5
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