]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix some incorrect asserts() in the pager - problems brought to light by
authordrh <drh@noemail.net>
Fri, 10 Aug 2007 23:56:35 +0000 (23:56 +0000)
committerdrh <drh@noemail.net>
Fri, 10 Aug 2007 23:56:35 +0000 (23:56 +0000)
the new soft-heap-limit testing apparatus of check-in (4202). (CVS 4207)

FossilOrigin-Name: 51f3e01b7486f23b67bdfb6bb19fc5297b2c8cec

manifest
manifest.uuid
src/pager.c

index b5a9914df85a0c1a1a51812ee4a8e0ab931df074..ffff6c33cfc9d26e555eefe5f2808a097d164f17 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sthe\scorruption\sproblem\sof\sticket\s#2565\sas\sdemonstrated\sby\sthe\stest\sadded\nin\s(4204).\s\sThere\smay\syet\sbe\sother\sinstances\sof\ssimilar\sproblems\slurking\sin\nthe\scode.\s(CVS\s4206)
-D 2007-08-10T23:54:16
+C Fix\ssome\sincorrect\sasserts()\sin\sthe\spager\s-\sproblems\sbrought\sto\slight\sby\nthe\snew\ssoft-heap-limit\stesting\sapparatus\sof\scheck-in\s(4202).\s(CVS\s4207)
+D 2007-08-10T23:56:36
 F Makefile.in 0c0e53720f658c7a551046442dd7afba0b72bfbe
 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -99,7 +99,7 @@ F src/os_unix.c 9d2a421acc607262e63ccf31e3fe86e5f2520af6
 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
 F src/os_win.c d868d5f9e95ec9c1b9e2a30c54c996053db6dddd
 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
-F src/pager.c e4fec09c20201eaeca5f6a8fb2d6cdd415d97561
+F src/pager.c 7a96ab0dcab56bd5c9828272b5ad5fc14b296c66
 F src/pager.h 94110a5570dca30d54a883e880a3633b2e4c05ae
 F src/parse.y ad2ce25665be7f7303137f774a4e3e72e0d036ff
 F src/pragma.c 7914a6b9ea05f158800116dfcae11e52ab8e39c4
@@ -524,7 +524,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 16730cb137eaf576b87cdc17913564c9c5c0ed82
-R 603090945b8a1fdc30880037c12bb741
+P 7ed2f59e70e0d9a8ad0c47c8c12fae0aaddcedce
+R 035ac0a060bdc969e9fcae1ee2c83e7d
 U drh
-Z f116d28be22086d6409bcb0a7433f127
+Z 4968e3414a1d697b3f9b9029760dffed
index 352589668e905e9075027da288df4709c4e92a43..a37a12de3e4d70b1d3f70d5083f5507a897e392e 100644 (file)
@@ -1 +1 @@
-7ed2f59e70e0d9a8ad0c47c8c12fae0aaddcedce
\ No newline at end of file
+51f3e01b7486f23b67bdfb6bb19fc5297b2c8cec
\ No newline at end of file
index 7846174d1720f19b637814acf4f24559eee8a149..5c95f8ab497d6a56ca3afc51e510f094a0a4e89e 100644 (file)
@@ -18,7 +18,7 @@
 ** file simultaneously, or one process from reading the database while
 ** another is writing.
 **
-** @(#) $Id: pager.c,v 1.353 2007/08/10 23:54:16 drh Exp $
+** @(#) $Id: pager.c,v 1.354 2007/08/10 23:56:36 drh Exp $
 */
 #ifndef SQLITE_OMIT_DISKIO
 #include "sqliteInt.h"
@@ -562,7 +562,11 @@ static int write32bits(OsFile *fd, u32 val){
 */
 static int pager_error(Pager *pPager, int rc){
   int rc2 = rc & 0xff;
-  assert( pPager->errCode==SQLITE_FULL || pPager->errCode==SQLITE_OK );
+  assert(
+       pPager->errCode==SQLITE_FULL ||
+       pPager->errCode==SQLITE_OK ||
+       (pPager->errCode & 0xff)==SQLITE_IOERR
+  );
   if(
     rc2==SQLITE_FULL ||
     rc2==SQLITE_IOERR ||
@@ -2755,7 +2759,7 @@ int sqlite3PagerReleaseMemory(int nReq){
           pTmp->pNextAll = pPg->pNextAll;
         }
         nReleased += sqliteAllocSize(pPg);
-        IOTRACE(("PGFREE %p %d\n", pPager, pPg->pgno));
+        IOTRACE(("PGFREE %p %d *\n", pPager, pPg->pgno));
         PAGER_INCR(sqlite3_pager_pgfree_count);
         sqliteFree(pPg);
       }
@@ -2767,7 +2771,11 @@ int sqlite3PagerReleaseMemory(int nReq){
         ** The error will be returned to the user (or users, in the case 
         ** of a shared pager cache) of the pager for which the error occured.
         */
-        assert( (rc&0xff)==SQLITE_IOERR || rc==SQLITE_FULL );
+        assert(
+            (rc&0xff)==SQLITE_IOERR ||
+            rc==SQLITE_FULL ||
+            rc==SQLITE_BUSY
+        );
         assert( pPager->state>=PAGER_RESERVED );
         pager_error(pPager, rc);
       }