diff options
author | drh <> | 2022-05-30 17:33:22 +0000 |
---|---|---|
committer | drh <> | 2022-05-30 17:33:22 +0000 |
commit | 404bf6bac6569664b23a35c22fbb18611b7c6b7c (patch) | |
tree | d8f653cac8874c30145106934d76dd684a487cd3 /src/wherecode.c | |
parent | 1943005f626fbefa1fb32f77fc671ee07c52b11f (diff) | |
download | sqlite-404bf6bac6569664b23a35c22fbb18611b7c6b7c.tar.gz sqlite-404bf6bac6569664b23a35c22fbb18611b7c6b7c.zip |
For an outer join, then ON-clause constraints need to be evaluated at just
the right moment - not too early and not too late. Fix for the problem
reported by [forum:/forumpost/3902c7b833|forum post 3902c7b833].
FossilOrigin-Name: 3869fd9a2b9483cbbf83d8f369c1744abc42f12e63abba402be35dd7e136161c
Diffstat (limited to 'src/wherecode.c')
-rw-r--r-- | src/wherecode.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/wherecode.c b/src/wherecode.c index 3902c24f9..6617b6039 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -2624,12 +2624,9 @@ Bitmask sqlite3WhereCodeOneLoopStart( /* Defer processing WHERE clause constraints until after outer ** join processing. tag-20220513a */ continue; - }else{ - Bitmask m = sqlite3WhereGetMask(&pWInfo->sMaskSet, pE->w.iJoin); - if( m & pLevel->notReady ){ - /* An ON clause that is not ripe */ - continue; - } + }else if( (pTabItem->fg.jointype & JT_LEFT)==JT_LEFT + && !ExprHasProperty(pE,EP_OuterON) ){ + continue; } } if( iLoop==1 && !sqlite3ExprCoveredByIndex(pE, pLevel->iTabCur, pIdx) ){ |