From: drh Date: Thu, 26 Jan 2017 17:26:44 +0000 (+0000) Subject: Remove the obsolete lastRowid cache from the sqlite3VdbeExec() for a size X-Git-Tag: version-3.17.0~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fae58d51cee559af3c71860dce26ee0007f4780d;p=thirdparty%2Fsqlite.git Remove the obsolete lastRowid cache from the sqlite3VdbeExec() for a size reduction and performance improvement. FossilOrigin-Name: b4803184652e5f4f823c1521412bc480baeb3dbf --- diff --git a/manifest b/manifest index 11ce60cdc3..2bd3d3e394 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Performance\soptimization\sin\ssqlite3VdbeCloseStatement(). -D 2017-01-26T17:11:18.355 +C Remove\sthe\sobsolete\slastRowid\scache\sfrom\sthe\ssqlite3VdbeExec()\sfor\sa\ssize\nreduction\sand\sperformance\simprovement. +D 2017-01-26T17:26:44.998 F Makefile.in 5f415e7867296d678fed2e6779aea10c1318b4bc F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da @@ -457,7 +457,7 @@ F src/update.c b356b29d04c71f33c779f2cb557cf953819bdd7a F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c F src/util.c a88b0466fddf445ce752226d4698ca3faada620a F src/vacuum.c 33c174b28886b2faf26e503b5a49a1c01a9b1c16 -F src/vdbe.c 1fa3e8f3ee1cdfc56d9559bca9ca2c84e4a398be +F src/vdbe.c 96f1639399feb97500d927219b87183aad3ef94c F src/vdbe.h 59998ffd71d7caa8886bc78dafaf8caeccd4c13c F src/vdbeInt.h 281cb70332dc8b593b8c7afe776f3a2ba7d4255e F src/vdbeapi.c 7a65f10684982daecfce50f557f2632b7f20b198 @@ -1547,7 +1547,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 7459f4b7ed4007d9ec44c3bf0fcba04f5f8540a9 -R b420e83a1f23766d77baebce9b33f9ae +P 1e96e5ec1ee617cb5b5cbdc5a2ee79c8cc35821d +R f17134692e3127e9f97d9e12f2b91a46 U drh -Z 2c16f151f6d1962e9b2a5835576e2c7c +Z 7f3d9d2e9e1038bd56eb8c4623402887 diff --git a/manifest.uuid b/manifest.uuid index 9f15fbe8cb..313588dfbb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1e96e5ec1ee617cb5b5cbdc5a2ee79c8cc35821d \ No newline at end of file +b4803184652e5f4f823c1521412bc480baeb3dbf \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index 6838acccd5..afb23007c6 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -584,7 +584,6 @@ int sqlite3VdbeExec( Mem *pIn3 = 0; /* 3rd input operand */ Mem *pOut = 0; /* Output operand */ int *aPermute = 0; /* Permutation of columns for OP_Compare */ - i64 lastRowid = db->lastRowid; /* Saved value of the last insert ROWID */ #ifdef VDBE_PROFILE u64 start; /* CPU clock count at start of opcode */ #endif @@ -960,7 +959,6 @@ case OP_Halt: { p->nFrame--; sqlite3VdbeSetChanges(db, p->nChange); pcx = sqlite3VdbeFrameRestore(pFrame); - lastRowid = db->lastRowid; if( pOp->p2==OE_Ignore ){ /* Instruction pcx is the OP_Program that invoked the sub-program ** currently being halted. If the p2 instruction of this OP_Halt @@ -1682,9 +1680,7 @@ case OP_Function: { #endif MemSetTypeFlag(pCtx->pOut, MEM_Null); pCtx->fErrorOrAux = 0; - db->lastRowid = lastRowid; (*pCtx->pFunc->xSFunc)(pCtx, pCtx->argc, pCtx->argv);/* IMP: R-24505-23230 */ - lastRowid = db->lastRowid; /* Remember rowid changes made by xSFunc */ /* If the function returned an error, throw an exception */ if( pCtx->fErrorOrAux ){ @@ -4418,7 +4414,7 @@ case OP_InsertInt: { #endif if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++; - if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = lastRowid = x.nKey; + if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = x.nKey; if( pData->flags & MEM_Null ){ x.pData = 0; x.nData = 0; @@ -5863,7 +5859,7 @@ case OP_Program: { /* jump */ p->nFrame++; pFrame->pParent = p->pFrame; - pFrame->lastRowid = lastRowid; + pFrame->lastRowid = db->lastRowid; pFrame->nChange = p->nChange; pFrame->nDbChange = p->db->nChange; assert( pFrame->pAuxData==0 ); @@ -6804,7 +6800,7 @@ case OP_VUpdate: { sqlite3VtabImportErrmsg(p, pVtab); if( rc==SQLITE_OK && pOp->p1 ){ assert( nArg>1 && apArg[0] && (apArg[0]->flags&MEM_Null) ); - db->lastRowid = lastRowid = rowid; + db->lastRowid = rowid; } if( (rc&0xff)==SQLITE_CONSTRAINT && pOp->p4.pVtab->bConstraint ){ if( pOp->p5==OE_Ignore ){ @@ -7040,7 +7036,6 @@ abort_due_to_error: ** release the mutexes on btrees that were acquired at the ** top. */ vdbe_return: - db->lastRowid = lastRowid; testcase( nVmStep>0 ); p->aCounter[SQLITE_STMTSTATUS_VM_STEP] += (int)nVmStep; sqlite3VdbeLeave(p);