aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wherecode.c')
-rw-r--r--src/wherecode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index a942e6e7f..979944e2e 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -2621,7 +2621,8 @@ Bitmask sqlite3WhereCodeOneLoopStart(
pE = pTerm->pExpr;
assert( pE!=0 );
if( (pTabItem->fg.jointype & (JT_LEFT|JT_LTORJ))
- && !ExprHasProperty(pE,EP_FromJoin|EP_InnerJoin)
+ && (!ExprHasProperty(pE,EP_FromJoin|EP_InnerJoin)
+ || pE->w.iJoin!=pTabItem->iCursor)
){
continue;
}