diff options
author | 2014-09-29 22:55:55 +0000 | |
---|---|---|
committer | 2014-09-29 22:55:55 +0000 | |
commit | a586bd9e68992abfe8e47f70f665db82fd484f8a (patch) | |
tree | e9468eb44816e86d3baf5af9c8b385ece347f254 /lib/libsqlite3/src/delete.c | |
parent | lightly document mailq; ok gilles (diff) | |
download | wireguard-openbsd-a586bd9e68992abfe8e47f70f665db82fd484f8a.tar.xz wireguard-openbsd-a586bd9e68992abfe8e47f70f665db82fd484f8a.zip |
Update sqlite3 to 3.8.6. A list of changes are available here:
http://sqlite.org/releaselog/3_8_6.html.
Tested in a bulk and ok landry@
Diffstat (limited to 'lib/libsqlite3/src/delete.c')
-rw-r--r-- | lib/libsqlite3/src/delete.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/libsqlite3/src/delete.c b/lib/libsqlite3/src/delete.c index 79e83cae527..c74d8eab7d5 100644 --- a/lib/libsqlite3/src/delete.c +++ b/lib/libsqlite3/src/delete.c @@ -739,7 +739,7 @@ void sqlite3GenerateRowIndexDelete( &iPartIdxLabel, pPrior, r1); sqlite3VdbeAddOp3(v, OP_IdxDelete, iIdxCur+i, r1, pIdx->uniqNotNull ? pIdx->nKeyCol : pIdx->nColumn); - sqlite3VdbeResolveLabel(v, iPartIdxLabel); + sqlite3ResolvePartIdxLabel(pParse, iPartIdxLabel); pPrior = pIdx; } } @@ -758,10 +758,11 @@ void sqlite3GenerateRowIndexDelete( ** ** If *piPartIdxLabel is not NULL, fill it in with a label and jump ** to that label if pIdx is a partial index that should be skipped. +** The label should be resolved using sqlite3ResolvePartIdxLabel(). ** A partial index should be skipped if its WHERE clause evaluates ** to false or null. If pIdx is not a partial index, *piPartIdxLabel ** will be set to zero which is an empty label that is ignored by -** sqlite3VdbeResolveLabel(). +** sqlite3ResolvePartIdxLabel(). ** ** The pPrior and regPrior parameters are used to implement a cache to ** avoid unnecessary register loads. If pPrior is not NULL, then it is @@ -794,6 +795,7 @@ int sqlite3GenerateIndexKey( if( pIdx->pPartIdxWhere ){ *piPartIdxLabel = sqlite3VdbeMakeLabel(v); pParse->iPartIdxTab = iDataCur; + sqlite3ExprCachePush(pParse); sqlite3ExprIfFalse(pParse, pIdx->pPartIdxWhere, *piPartIdxLabel, SQLITE_JUMPIFNULL); }else{ @@ -821,3 +823,15 @@ int sqlite3GenerateIndexKey( sqlite3ReleaseTempRange(pParse, regBase, nCol); return regBase; } + +/* +** If a prior call to sqlite3GenerateIndexKey() generated a jump-over label +** because it was a partial index, then this routine should be called to +** resolve that label. +*/ +void sqlite3ResolvePartIdxLabel(Parse *pParse, int iLabel){ + if( iLabel ){ + sqlite3VdbeResolveLabel(pParse->pVdbe, iLabel); + sqlite3ExprCachePop(pParse); + } +} |