Skip to content

Unexpected result when using Boolean in IN #7338

Description

@suyZhong

Considering the test case below:

CREATE TABLE t0( c0 VARCHAR(500));
CREATE INDEX t0i0 ON t0( c0 );
INSERT INTO t0 (c0) VALUES (false);

SELECT * FROM t0; -- 0 
SELECT (t0.c0 IN (false/'1')) FROM t0; -- 1
SELECT * FROM t0 WHERE (t0.c0 IN (false/'1'));
-- Expected: 0
-- Actual: Empty

The third SELECT returns an empty result, which is surprising: If the result of second query is 1, the value of the IN expression should be 1, and thus the third query should return the row in t0.

I originally found this issue by building dolt from source version 5f6b95f

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions