1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

If terms of the WHERE clause require that the right table in a LEFT JOIN

not be a null row, then simplify the LEFT JOIN into an ordinary JOIN.

FossilOrigin-Name: 5b7abecc7ab8ccbbb8cb5e0f672e67625c2555ad03442efbf34cb395f5bb71a8
This commit is contained in:
drh
2018-03-20 21:16:15 +00:00
parent f6e6f02308
commit 2589787c5a
7 changed files with 109 additions and 14 deletions

View File

@ -748,7 +748,7 @@ do_execsql_test e_select-3.2.1a {
SELECT k FROM x1 LEFT JOIN x2 USING(k)
} {1 2 3 4 5 6}
do_execsql_test e_select-3.2.1b {
SELECT k FROM x1 LEFT JOIN x2 USING(k) WHERE x2.k
SELECT k FROM x1 LEFT JOIN x2 USING(k) WHERE x2.k ORDER BY +k
} {1 3 5}
do_execsql_test e_select-3.2.2 {
SELECT k FROM x1 LEFT JOIN x2 USING(k) WHERE x2.k IS NULL