1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

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
This commit is contained in:
drh
2022-05-30 17:33:22 +00:00
parent 1943005f62
commit 404bf6bac6
4 changed files with 48 additions and 14 deletions

View File

@@ -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) ){