diff options
author | drh <> | 2021-12-08 16:15:41 +0000 |
---|---|---|
committer | drh <> | 2021-12-08 16:15:41 +0000 |
commit | c491a25631f33edd8d628780678833f46ae9925e (patch) | |
tree | 19e704245da68d33661068bb6b83814760105ead /src/wherecode.c | |
parent | 761d64b73bc7ceb5ef60d956b6e1b78c1997082d (diff) | |
parent | 132f96fc75496d93cc01be7dabb11eea55bddea2 (diff) | |
download | sqlite-c491a25631f33edd8d628780678833f46ae9925e.tar.gz sqlite-c491a25631f33edd8d628780678833f46ae9925e.zip |
Merge the WhereClause fix from trunk
FossilOrigin-Name: d3250256772e3348abe887c0ca3550a6647cce3804c9456a9d0112aea7ee1c46
Diffstat (limited to 'src/wherecode.c')
-rw-r--r-- | src/wherecode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wherecode.c b/src/wherecode.c index c04a73c2a..42cfcc9ea 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -1033,7 +1033,7 @@ static void codeCursorHint( sWalker.pParse = pParse; sWalker.u.pCCurHint = &sHint; pWC = &pWInfo->sWC; - for(i=0; i<pWC->nTerm; i++){ + for(i=0; i<pWC->nBase; i++){ pTerm = &pWC->a[i]; if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; if( pTerm->prereqAll & pLevel->notReady ) continue; @@ -2598,7 +2598,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( ** then we cannot use the "t1.a=t2.b" constraint, but we can code ** the implied "t1.a=123" constraint. */ - for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){ + for(pTerm=pWC->a, j=pWC->nBase; j>0; j--, pTerm++){ Expr *pE, sEAlt; WhereTerm *pAlt; if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; @@ -2643,7 +2643,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( pLevel->addrFirst = sqlite3VdbeCurrentAddr(v); sqlite3VdbeAddOp2(v, OP_Integer, 1, pLevel->iLeftJoin); VdbeComment((v, "record LEFT JOIN hit")); - for(pTerm=pWC->a, j=0; j<pWC->nTerm; j++, pTerm++){ + for(pTerm=pWC->a, j=0; j<pWC->nBase; j++, pTerm++){ testcase( pTerm->wtFlags & TERM_VIRTUAL ); testcase( pTerm->wtFlags & TERM_CODED ); if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |