From: drh Date: Wed, 3 Oct 2007 18:45:04 +0000 (+0000) Subject: Simplify the vdbeHalt logic slightly. (CVS 4459) X-Git-Tag: version-3.6.10~1718 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d181704ec5c0024af18a64f1e31c26dfa422cec4;p=thirdparty%2Fsqlite.git Simplify the vdbeHalt logic slightly. (CVS 4459) FossilOrigin-Name: b59f7bcbabcccde9d2519e10e65e121343f2af7a --- diff --git a/manifest b/manifest index 6938377eb2..7207c50d5f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Rollback\sthe\stransaction\sif\san\sSQLITE_FULL\serror\sis\sencountered.\nThis\sis\sa\spreliminary\sfix\sfor\sticket\s#2686.\s\sMore\stesting\sand\nanalysis\sis\sneeded\sbefore\swe\sclose\sthe\sticket.\s(CVS\s4458) -D 2007-10-03T15:30:52 +C Simplify\sthe\svdbeHalt\slogic\sslightly.\s(CVS\s4459) +D 2007-10-03T18:45:04 F Makefile.in cbfb898945536a8f9ea8b897e1586dd1fdbcc5db F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -168,7 +168,7 @@ F src/vdbe.c b6c53921512496ef4d7c4f571feb73b7a495db35 F src/vdbe.h 03a0fa17f6753a24d6cb585d7a362944a2c115aa F src/vdbeInt.h 630145b9bfaa19190ab491f52658a7db550f2247 F src/vdbeapi.c 9c2d681b75e4b90c28b9dd01a3f2e5905267f884 -F src/vdbeaux.c 9bb437cb69ae45d7ae2acfcb83264d8bd15b39cc +F src/vdbeaux.c 5f1e5e98a13235cbc446501fe040eb31423fface F src/vdbeblob.c 82f51cdf9b0c0af729732fde48c824e498c0a1ca F src/vdbefifo.c 334c838c8f42d61a94813d136019ee566b5dc2f6 F src/vdbemem.c 246d434fa60bde6553490eb686adfd86adcd6712 @@ -581,7 +581,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P 3d1d13d1eb5817c22956e6e7792783116a828962 -R 2dfb044e805a2e65c272b67cf877a8ea +P 0fb6d5a5773c282882e7283e6f8f8c009e238ff4 +R 8078f77f6e7647e7ac36c0ae1aed3ae9 U drh -Z fad836448ac64c67c038efdc32241a75 +Z b6a4257494f5195bec3aaf8c352cc04d diff --git a/manifest.uuid b/manifest.uuid index 7d84e972d5..afae7f9a69 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0fb6d5a5773c282882e7283e6f8f8c009e238ff4 \ No newline at end of file +b59f7bcbabcccde9d2519e10e65e121343f2af7a \ No newline at end of file diff --git a/src/vdbeaux.c b/src/vdbeaux.c index bdea2a539f..8a6187214a 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -1398,25 +1398,13 @@ int sqlite3VdbeHalt(Vdbe *p){ ** this is probably easier. Todo: Might be an opportunity to reduce ** code size a very small amount though... */ - int isReadOnly = 1; + int notReadOnly = 0; int isStatement = 0; assert(p->aOp || p->nOp==0); for(i=0; inOp; i++){ switch( p->aOp[i].opcode ){ case OP_Transaction: - /* This is a bit strange. If we hit a malloc() or IO error and - ** the statement did not open a statement transaction, we will - ** rollback any active transaction and abort all other active - ** statements. Or, if this is an SQLITE_INTERRUPT error, we - ** will only rollback if the interrupted statement was a write. - ** - ** It could be argued that read-only statements should never - ** rollback anything. But careful analysis is required before - ** making this change - */ - if( p->aOp[i].p2 || mrc!=SQLITE_INTERRUPT ){ - isReadOnly = 0; - } + notReadOnly |= p->aOp[i].p2; break; case OP_Statement: isStatement = 1; @@ -1428,11 +1416,11 @@ int sqlite3VdbeHalt(Vdbe *p){ /* If the query was read-only, we need do no rollback at all. Otherwise, ** proceed with the special handling. */ - if( !isReadOnly ){ + if( notReadOnly || mrc!=SQLITE_INTERRUPT ){ if( p->rc==SQLITE_IOERR_BLOCKED && isStatement ){ xFunc = sqlite3BtreeRollbackStmt; p->rc = SQLITE_BUSY; - } else if( (p->rc==SQLITE_NOMEM || p->rc==SQLITE_FULL) && isStatement ){ + } else if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) && isStatement ){ xFunc = sqlite3BtreeRollbackStmt; }else{ /* We are forced to roll back the active transaction. Before doing