Skip to content

Wrong inner join result #17561

@TheoristCoder

Description

@TheoristCoder

What happens?

Dear DuckDB Developers,
Please see the following cases.

CREATE TABLE t0(c0 INT);
CREATE TABLE t1(c0 BOOL);

INSERT INTO t1(c0) VALUES (false);
INSERT INTO t0(c0) VALUES (NULL);

SELECT * FROM t0 INNER JOIN t1 on NOT(t1.c0) and ((false)<(((IFNULL(t0.c0, 1)))));
-- empty result
-- expected result: NULL, false

Expected result: https://www.db-fiddle.com/f/e7u1hbDEh3pP5HburohfsC/0

To Reproduce

CREATE TABLE t0(c0 INT);
CREATE TABLE t1(c0 BOOL);

INSERT INTO t1(c0) VALUES (false);
INSERT INTO t0(c0) VALUES (NULL);

SELECT * FROM t0 INNER JOIN t1 on NOT(t1.c0) and ((false)<(((IFNULL(t0.c0, 1)))));
-- empty result
-- expected result: NULL, false

OS:

MacOS

DuckDB Version:

DuckDB v1.3.0-dev3620 (Development Version) ee225e8

DuckDB Client:

CLI

Hardware:

No response

Full Name:

TheoristCoder

Affiliation:

Personal Project

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a nightly build

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions