1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

One of the optimizations of check-in [de9c86c9e4cdb34f] does not work for

terms originating in the ON/USING clause, as demonstrated by
[forum:/forumpost/6cf3bb457c3f4685|forum post 6cf3bb457c3f4685].  This
check-in disables that optimization for ON/USING terms.  Also improve the
TreeView display for the resulting "true"/"false" nodes to show that they
originate from the ON/USING clause.  Add a testcase() to the other optimization
to show that it can still be used for ON/USING terms.

FossilOrigin-Name: 1f6796044008e6f3a61bcf390c0c7eb31947e971f0edada74e7a3a211f8ae76a
This commit is contained in:
drh
2021-07-22 16:07:01 +00:00
parent c8d214711f
commit 348e002ec9
6 changed files with 38 additions and 13 deletions

View File

@@ -109,4 +109,24 @@ do_execsql_test 3.1 {
SELECT * FROM t0 WHERE ((c0 NOT NULL) AND 1) OR (c0 == NULL);
} {0}
# 2021-07-22 https://sqlite.org/forum/forumpost/2078b7edd2
#
reset_db
do_execsql_test 4.0 {
SELECT *, '/'
FROM (
SELECT NULL val FROM (SELECT 1)
UNION ALL
SELECT 'missing' FROM (SELECT 1)
) a
LEFT JOIN (SELECT 1)
ON a.val IS NULL;
} {{} 1 / missing {} /}
do_execsql_test 4.1 {
CREATE TABLE t1(a INT);
INSERT INTO t1(a) VALUES(1);
CREATE TABLE t2(b INT);
SELECT * FROM (SELECT 3 AS c FROM t1) AS t3 LEFT JOIN t2 ON c IS NULL;
} {3 {}}
finish_test