SQLite User Forum

Unexpected Result by Joining
Login

Unexpected Result by Joining

(1) By Jinsheng Ba (bajinsheng) on 2022-05-31 08:41:02 [source]

See this inconsistent results.

CREATE TABLE t0 (c0);
CREATE TABLE t1 (c0);
CREATE TABLE t2 (c0);
INSERT INTO t1(c0) VALUES ('x');
INSERT INTO t2 VALUES ('1'), ('2');
SELECT count(*) FROM t0 RIGHT OUTER JOIN t1 LEFT OUTER JOIN t2 ON t0.c0;
--  1
SELECT count(*) FROM t0 RIGHT OUTER JOIN t1 LEFT OUTER JOIN t2 ON t0.c0 WHERE t2.c0;
-- 2 

Environment:

Version: 3.39.0

Commit ID: 40925585

OS: Ubuntu 20.04

Configuration Options: ./configure --enable-all

Compiler: gcc-9

Client: CLI

(2) By Richard Hipp (drh) on 2022-05-31 10:47:10 in reply to 1 [link] [source]

This appears to be a refutation of the "fix" from yesterday. Backing out that prior "fix" causes these queries to work correctly.

(3) By Richard Hipp (drh) on 2022-05-31 11:23:01 in reply to 1 [link] [source]

Problem should now be fixed on trunk. Thank you for the bug report.

(4) By Jinsheng Ba (bajinsheng) on 2022-06-01 07:40:05 in reply to 3 [link] [source]

Thanks!