Skip to content

Unexpected Result when Querying with CONCAT #7261

Description

@suyZhong

Considering the test case below:

CREATE TABLE t0(c0 INT, PRIMARY KEY(c0));
INSERT INTO t0 (c0) VALUES (0);

SELECT c0 FROM t0; -- 0
SELECT c0 > (CONCAT(-0.5)) FROM t0; -- 1
SELECT c0 FROM t0 WHERE (c0>(CONCAT(-0.5)));
-- Expected: 0
-- Actual: empty

The third SELECT returns an empty result, which is surprising: If the result of second query is 1 (TRUE), the value of the CONCAT should be less than c0, and thus the third query should return the row in t0.

These test cases works well in MySQL, however not in dolt.

I originally find this by building dolt from source version 2d0a2ed. It could also be reproduced in 1.29.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions