]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a leaked page reference that could occur after an IO error in auto-vacuum databas...
authordanielk1977 <danielk1977@noemail.net>
Wed, 23 May 2007 13:34:32 +0000 (13:34 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Wed, 23 May 2007 13:34:32 +0000 (13:34 +0000)
FossilOrigin-Name: e691f2fa3d8c1bbb66d27eea299ae2fb1ea1a16d

manifest
manifest.uuid
src/btree.c
test/incrvacuum.test

index 5db49b98dbbd41ec16b2390fe32e6dc354dee6db..0d7340ae32a1e8a6698972a7856682052d91a823 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\sdatabase\scorrupting\sbug\sin\sthe\soptimistic\soverflow\schain.\sExposed\sby\srunning\sbigrow.test\swith\sauto-vacuum\senabled.\s(CVS\s4030)
-D 2007-05-23T09:52:42
+C Fix\sa\sleaked\spage\sreference\sthat\scould\soccur\safter\san\sIO\serror\sin\sauto-vacuum\sdatabases.\sAlso\smodify\sincrvacuum.test\sto\swork\swith\sDEFAULT_AUTOVACUUM=1\sbuilds.\s(CVS\s4031)
+D 2007-05-23T13:34:32
 F Makefile.in a42354804b50c2708ce72cf79e4daa30f50191b5
 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -62,7 +62,7 @@ F src/alter.c 1b1deeb97446ed87f2fa17a3eb6236548841a348
 F src/analyze.c e8fcb1c35ace8418615eb18d9601f321ac86b2ec
 F src/attach.c ba628db0c2b6a362f036d017bf1196cdfe4ebb37
 F src/auth.c 5ea90bc93dfea46e9fe4bf531e14c7cd98219ecb
-F src/btree.c 8b39c5aad153744919c79efbeca92a17e5167c2f
+F src/btree.c 7e3d0c6a9e9be836a0acbf2b80759193130d9059
 F src/btree.h 1d527bf61ed176f980c34999d5793a0fd45dcf8c
 F src/btreeInt.h f92c0577f49d961c0148b477a25647e8fd80eecf
 F src/build.c 50992d92e131a9aa9aa6657fb1ddc13e176fd70c
@@ -258,7 +258,7 @@ F test/in.test 369cb2aa1eab02296b4ec470732fe8c131260b1d
 F test/in2.test b1f447f4f0f67e9f83ff931e7e2e30873f9ea055
 F test/incrblob.test 7f82ae497364612aa17a37f77f12e01e2bee9f20
 F test/incrblob_err.test 2501bec57e317e7051451b5093b47fc61a96c85a
-F test/incrvacuum.test f490c8ae86f2ecca622425d02e27d3119058cb21
+F test/incrvacuum.test 0c88ba35bd6ba1ce2dc9ac953911481d2e626acc
 F test/incrvacuum2.test 82397ceb5941cbe852fd29bb33fcdf5665bc80c2
 F test/incrvacuum_ioerr.test cb331403b8dea3c5bae6163861ff25037b0df56a
 F test/index.test e65df12bed94b2903ee89987115e1578687e9266
@@ -494,7 +494,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P dd48a31e671de09f59661b2ba1a20e7b9f09099a
-R 0a4b7a5a7560782609618616930efe42
+P 10ee2d50cbcdcbbd8141ff2aba4fd2c0c0b70d67
+R e6f6e35a3430fe940ba19e54e2cd3045
 U danielk1977
-Z 355df7558cb933d10fd908dea6dfeba4
+Z 7dafc679264f64c59efbb8f3edda007b
index 0f1c5b30d87c8a52a7f741163b8d77d3f8d8efa8..d29ac8448cbc12681e5ce6fb2dd321a3da82f781 100644 (file)
@@ -1 +1 @@
-10ee2d50cbcdcbbd8141ff2aba4fd2c0c0b70d67
\ No newline at end of file
+e691f2fa3d8c1bbb66d27eea299ae2fb1ea1a16d
\ No newline at end of file
index 3d3a64d9effa9aeaed182b1b37a1203a659aada3..6d482709cc5a2308fabbc70019b25cc65f8c02ba 100644 (file)
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.384 2007/05/23 09:52:42 danielk1977 Exp $
+** $Id: btree.c,v 1.385 2007/05/23 13:34:32 danielk1977 Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** See the header comment on "btreeInt.h" for additional information.
@@ -3808,7 +3808,6 @@ static int fillInCell(
   Pgno pgnoOvfl = 0;
   int nHeader;
   CellInfo info;
-  Pgno pgnoFirstOvfl = 0;
 
   /* Fill in the header. */
   nHeader = 0;
@@ -3853,7 +3852,7 @@ static int fillInCell(
         } while( 
           PTRMAP_ISPAGE(pBt, pgnoOvfl) || pgnoOvfl==PENDING_BYTE_PAGE(pBt) 
         );
-        if( pgnoOvfl>1 && pgnoOvfl!=pgnoFirstOvfl ){
+        if( pgnoOvfl>1 ){
           /* isExact = 1; */
         }
       }
@@ -3873,8 +3872,9 @@ static int fillInCell(
       if( pBt->autoVacuum && rc==SQLITE_OK ){
         u8 eType = (pgnoPtrmap?PTRMAP_OVERFLOW2:PTRMAP_OVERFLOW1);
         rc = ptrmapPut(pBt, pgnoOvfl, eType, pgnoPtrmap);
-      }else{
-        pgnoFirstOvfl = pgnoOvfl;
+        if( rc ){
+          releasePage(pOvfl);
+        }
       }
 #endif
       if( rc ){
index 7eabafc075c19a641259673fc5b4d9d86427fa3c..269d6a4cd484bb8239fc9e950b92ddb0b6a58a86 100644 (file)
@@ -14,7 +14,7 @@
 # Note: There are also some tests for incremental vacuum and IO 
 # errors in incrvacuum_ioerr.test.
 #
-# $Id: incrvacuum.test,v 1.6 2007/05/04 18:30:41 drh Exp $
+# $Id: incrvacuum.test,v 1.7 2007/05/23 13:34:32 danielk1977 Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -33,7 +33,7 @@ do_test incrvacuum-1.1 {
   execsql {
     pragma auto_vacuum;
   }
-} {0}
+} $sqlite_options(default_autovacuum)
 do_test incrvacuum-1.2 {
   execsql {
     pragma auto_vacuum = 'full';