]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Simplify the vdbeHalt logic slightly. (CVS 4459)
authordrh <drh@noemail.net>
Wed, 3 Oct 2007 18:45:04 +0000 (18:45 +0000)
committerdrh <drh@noemail.net>
Wed, 3 Oct 2007 18:45:04 +0000 (18:45 +0000)
FossilOrigin-Name: b59f7bcbabcccde9d2519e10e65e121343f2af7a

manifest
manifest.uuid
src/vdbeaux.c

index 6938377eb28a09545265b40a0ea7357cd655b1fa..7207c50d5f9560fb0ffd56c41ae4db0cfaec7cb9 100644 (file)
--- 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
index 7d84e972d5d0f032d42795cd4782c80de354569c..afae7f9a699c42b7b7c1a4962b46ea7a1c725a5e 100644 (file)
@@ -1 +1 @@
-0fb6d5a5773c282882e7283e6f8f8c009e238ff4
\ No newline at end of file
+b59f7bcbabcccde9d2519e10e65e121343f2af7a
\ No newline at end of file
index bdea2a539f34e207f5e2741605d50d64b5d5201a..8a6187214a5dbbdfc16decbfc5cce4b77304a4b7 100644 (file)
@@ -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; i<p->nOp; 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