virtuoso-opensource icon indicating copy to clipboard operation
virtuoso-opensource copied to clipboard

Unexpected results when using `ORDER BY`

Open suyZhong opened this issue 1 year ago • 0 comments

Consider the test case below. It is unexpected that the second query return an empty result, as the first query return NULL, and the subsequent queries with ORDER BY shouldn't affect the result set.

DROP TABLE t0;
DROP TABLE t1;

CREATE TABLE t0(c0 INT);
CREATE TABLE t1(c0 INT);
INSERT INTO t1 (c0) VALUES (1);

SELECT t0.c0 FROM t1 LEFT  JOIN t0 ON 1; -- NULL
SELECT t0.c0 FROM t1 LEFT  JOIN t0 ON 1 ORDER BY 1 DESC; 
-- Expected: NULL
-- Actual: empty result

I build docker image following this: https://github.com/openlink/vos-reference-docker.

Here's the version: Version 07.20.3238-pthreads for Linux as of Feb 7 2024 (604fdc7)

suyZhong avatar Feb 07 '24 06:02 suyZhong