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:
11
src/where.c
11
src/where.c
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user