Skip to content

Unexpected result when using SQL #11019

@suyZhong

Description

@suyZhong

The second SELECT returns an empty result, which is surprising, given that the first query, which has the same WHERE clause, returns 2 as a result. The only difference between them is that the second query also references t1, which should not cause any rows to be omitted.

CREATE TABLE t0(c0 INT, c1 INT, PRIMARY KEY(c0));
CREATE TABLE t1(c0 INT, c1 INT, PRIMARY KEY(c0));
INSERT INTO t0(c0, c1) VALUES (2, NULL);
INSERT INTO t1(c0, c1) VALUES (1, 2);

SELECT t0.c0 FROM t0 WHERE t0.c0=2; -- 2
SELECT t0.c0 FROM t0,t1 WHERE t0.c0=2; -- empty

Environment:

Version: 2.15.0

docker image: 43c9273e8568

Client: sqlline in docker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions