aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/alter.c5
-rw-r--r--src/where.c2
-rw-r--r--src/wherecode.c2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/alter.c b/src/alter.c
index b68e18914..d3fe6bf2e 100644
--- a/src/alter.c
+++ b/src/alter.c
@@ -918,7 +918,10 @@ static RenameToken *renameTokenFind(
void *pPtr
){
RenameToken **pp;
- assert( pPtr!=0 );
+ if( pPtr==0 ){
+ assert( pParse->nErr || pParse->db->mallocFailed );
+ return 0;
+ }
for(pp=&pParse->pRename; (*pp); pp=&(*pp)->pNext){
if( (*pp)->p==pPtr ){
RenameToken *pToken = *pp;
diff --git a/src/where.c b/src/where.c
index 97814d431..5859f866e 100644
--- a/src/where.c
+++ b/src/where.c
@@ -1942,7 +1942,7 @@ static int whereLoopResize(sqlite3 *db, WhereLoop *p, int n){
static int whereLoopXfer(sqlite3 *db, WhereLoop *pTo, WhereLoop *pFrom){
whereLoopClearUnion(db, pTo);
if( whereLoopResize(db, pTo, pFrom->nLTerm) ){
- memset(&pTo->u, 0, sizeof(pTo->u));
+ memset(pTo, 0, WHERE_LOOP_XFER_SZ);
return SQLITE_NOMEM_BKPT;
}
memcpy(pTo, pFrom, WHERE_LOOP_XFER_SZ);
diff --git a/src/wherecode.c b/src/wherecode.c
index 25ba60854..6b4bc8a21 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -700,7 +700,7 @@ static int codeAllEqualityTerms(
if( nSkip ){
int iIdxCur = pLevel->iIdxCur;
- sqlite3VdbeAddOp3(v, OP_Null, 0, regBase, nSkip);
+ sqlite3VdbeAddOp3(v, OP_Null, 0, regBase, regBase+nSkip-1);
sqlite3VdbeAddOp1(v, (bRev?OP_Last:OP_Rewind), iIdxCur);
VdbeCoverageIf(v, bRev==0);
VdbeCoverageIf(v, bRev!=0);