aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
authordrh <>2023-06-02 18:05:54 +0000
committerdrh <>2023-06-02 18:05:54 +0000
commit038158e94aa5b5f8ba5253307d67d369b46bf367 (patch)
tree15fc0851227399fd0b7d4d42ec22d1a07651d2e2 /src/select.c
parenta3f943942c74a5a4030036b0400af87d8af5dc19 (diff)
downloadsqlite-038158e94aa5b5f8ba5253307d67d369b46bf367.tar.gz
sqlite-038158e94aa5b5f8ba5253307d67d369b46bf367.zip
Restore the LEFT JOIN strength reduction that was partially lost in
[d747afda5683ca5f] when strength reduction was generalized to all OUTER JOINs. FossilOrigin-Name: 2d962b84dd8ac2d0968f0283f8f082c1c2a7a1f99b59053b2ad8f58745396447
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c
index 0058955d1..4e7870365 100644
--- a/src/select.c
+++ b/src/select.c
@@ -7234,7 +7234,8 @@ int sqlite3Select(
** "OUTER JOIN strength reduction" in the SQLite documentation.
*/
if( (pItem->fg.jointype & (JT_LEFT|JT_LTORJ))!=0
- && sqlite3ExprImpliesNonNullRow(p->pWhere, pItem->iCursor)
+ && sqlite3ExprImpliesNonNullRow(p->pWhere, pItem->iCursor,
+ pItem->fg.jointype & JT_LTORJ)
&& OptimizationEnabled(db, SQLITE_SimplifyJoin)
){
if( pItem->fg.jointype & JT_LEFT ){