Skip to content

Unexpected results when Using RIGHT JOIN #1214

Description

@suyZhong

Consider the test cases below. It is unexpected that the following queries all return 1, since NULL IS NOT NULL and NULL IS NULL could not be evaluated to true at the same time.

CREATE TABLE t0(c0 INT);
CREATE TABLE t1(c1 INT);
INSERT INTO t1 (c1) VALUES (1);
SELECT * FROM t0 RIGHT JOIN t1 ON 1; -- NULL 1

-- At least one of the query should return empty result
SELECT * FROM t0 RIGHT JOIN t1 ON 1 WHERE (NULL IS NOT NULL); -- NULL 1
SELECT * FROM t0 RIGHT JOIN t1 ON 1 WHERE (NULL IS NULL); -- NULL 1

Here's the version I used:

docker run -i -t pkleef/virtuoso-opensource-7 version

[pkleef/virtuoso-opensource-7:7.2.12-r17.1-g466615d-ubuntu]

This Docker image is using the following version of Virtuoso:

Virtuoso Open Source Edition (Column Store) (multi threaded)
Version 7.2.12-dev.3238-pthreads as of Dec 15 2023 (e49c0644f)
Compiled for Linux (x86_64-ubuntu_bionic-linux-gnu)
Copyright (C) 1998-2023 OpenLink Software

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions