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

Do not search using ON clause constraints of LEFT JOINs to the right of

the table.

FossilOrigin-Name: 723f901a63313b64a9f10516711fb6136526b79b
This commit is contained in:
drh
2013-05-31 20:28:28 +00:00
parent a1f4124cf8
commit 79a13bfd1e
3 changed files with 9 additions and 7 deletions

View File

@@ -3996,6 +3996,7 @@ static int whereLoopAddBtreeIndex(
rLogSize = estLog(pProbe->aiRowEst[0]);
for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){
int nIn = 1;
if( pTerm->prereqRight & pNew->maskSelf ) continue;
pNew->wsFlags = savedLoop.wsFlags;
pNew->u.btree.nEq = savedLoop.u.btree.nEq;
pNew->nTerm = savedLoop.nTerm;
@@ -4146,6 +4147,7 @@ static int whereLoopAddBtree(
WhereTerm *pTerm;
WhereTerm *pWCEnd = pWC->a + pWC->nTerm;
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
if( pTerm->prereqRight & pNew->maskSelf ) continue;
if( termCanDriveIndex(pTerm, pSrc, 0) ){
pNew->u.btree.nEq = 1;
pNew->u.btree.pIndex = 0;