1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

More test cases and bug fixes.

FossilOrigin-Name: 140e97fde94fdc3babdd456ce1b22900ead0e40e2afe63d89d21ccdbf141b607
This commit is contained in:
drh
2022-04-10 17:14:48 +00:00
parent a20c71e9e8
commit e21e36dd2c
4 changed files with 56 additions and 10 deletions

View File

@@ -5894,6 +5894,7 @@ WhereInfo *sqlite3WhereBegin(
sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pRJ->iMatch, pPk->nKeyCol);
sqlite3VdbeSetP4KeyInfo(pParse, pPk);
}
pLoop->wsFlags &= ~WHERE_IDX_ONLY;
}
}
pWInfo->iTop = sqlite3VdbeCurrentAddr(v);
@@ -6169,10 +6170,15 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
WhereClause *pWC = &pWInfo->sWC;
WhereInfo *pSubWInfo;
SrcList sFrom;
Bitmask mAll = 0;
for(k=0; k<=i; k++){
mAll |= pWInfo->a[k].pWLoop->maskSelf;
}
for(k=0; k<pWC->nTerm; k++){
WhereTerm *pTerm = &pWC->a[i];
WhereTerm *pTerm = &pWC->a[k];
if( pTerm->wtFlags & TERM_VIRTUAL ) break;
if( pTerm->prereqAll & ~pLoop->maskSelf ) continue;
if( pTerm->prereqAll & ~mAll ) continue;
if( ExprHasProperty(pTerm->pExpr, EP_FromJoin) ) continue;
pSubWhere = sqlite3ExprAnd(pParse, pSubWhere,
sqlite3ExprDup(db, pTerm->pExpr, 0));
}
@@ -6208,6 +6214,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
sqlite3WhereEnd(pSubWInfo);
}
sqlite3ExprDelete(pParse->db, pSubWhere);
continue;
}
/* For a co-routine, change all OP_Column references to the table of