]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Comment out sqlite3BtreeFlags() when not in debug mode. Tweaks to
authordrh <drh@noemail.net>
Wed, 8 Jul 2009 15:14:50 +0000 (15:14 +0000)
committerdrh <drh@noemail.net>
Wed, 8 Jul 2009 15:14:50 +0000 (15:14 +0000)
database corruption detection logic in freeSpace(). (CVS 6861)

FossilOrigin-Name: 196cbf82290a308e78b13044d0fae993f2d5cb90

manifest
manifest.uuid
src/btree.c

index b9255ddfc0b68eee3f5de653fbe3d045143a94c8..64587835de646bb4d38f9c0bde3aba15cfb9c630 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\serror\shandling\sin\ssqlite3BtreePutData().\s(CVS\s6860)
-D 2009-07-08T13:55:29
+C Comment\sout\ssqlite3BtreeFlags()\swhen\snot\sin\sdebug\smode.\s\sTweaks\sto\ndatabase\scorruption\sdetection\slogic\sin\sfreeSpace().\s(CVS\s6861)
+D 2009-07-08T15:14:50
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -106,7 +106,7 @@ F src/auth.c 802a9439dfa0b8c208b10055cba400e82ef18025
 F src/backup.c 6f1c2d9862c8a3feb7739dfcca02c1f5352e37f3
 F src/bitvec.c 0ef0651714728055d43de7a4cdd95e703fac0119
 F src/btmutex.c 9b899c0d8df3bd68f527b0afe03088321b696d3c
-F src/btree.c 62fc49f212276891085693c47eb6c3dc0fb1b197
+F src/btree.c e95997f1c9a54562b9f99d5cfa0e3acdd88fd514
 F src/btree.h e761619e76a1125d2d82bd3613b5a7ac7d1ee6f7
 F src/btreeInt.h b31e5ac04181c7e2892c33ab06228c551df6233c
 F src/build.c 867028ee9f63f7bc8eb8d4a720bb98cf9b9a12b4
@@ -740,7 +740,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
-P 0cc705c2c4aa06c33361b11c06423ff76d9eed7c
-R 1e0967d46dedb8b1441a379004f1ea6c
-U danielk1977
-Z 29cd6f499d3f0d09a4b738ba4390c723
+P 86eba4f16fd9e97344ab6dfb9cb9a85cf14751dd
+R 77bdafcdba4dd2c5e2b38b3389f64b9d
+U drh
+Z 8aa5344ef6ac6101e28f4ec787507ab1
index c7804502c7d11887714edb231e4aed79ca735b7a..15d0ecd77952e65ac51ef3ede6f8df9f6017a546 100644 (file)
@@ -1 +1 @@
-86eba4f16fd9e97344ab6dfb9cb9a85cf14751dd
\ No newline at end of file
+196cbf82290a308e78b13044d0fae993f2d5cb90
\ No newline at end of file
index 818eb7033a1760816cbec5be6e4b6d3fd2698747..51136b95cb95b849f70a0769667ce40f11ae979b 100644 (file)
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.660 2009/07/08 13:55:29 danielk1977 Exp $
+** $Id: btree.c,v 1.661 2009/07/08 15:14:50 drh Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** See the header comment on "btreeInt.h" for additional information.
@@ -1068,9 +1068,8 @@ static int defragmentPage(MemPage *pPage){
       return SQLITE_CORRUPT_BKPT;
     }
 #endif
-    assert( cbrk+size<=usableSize && cbrk>=iCellFirst );
+    assert( cbrk+size<=usableSize && cbrk>iCellFirst );
     testcase( cbrk+size==usableSize );
-    testcase( cbrk==iCellFirst );
     testcase( pc+size==usableSize );
     memcpy(&data[cbrk], &temp[pc], size);
     put2byte(pAddr, cbrk);
@@ -1215,8 +1214,9 @@ static int freeSpace(MemPage *pPage, int start, int size){
   hdr = pPage->hdrOffset;
   addr = hdr + 1;
   iLast = pPage->pBt->usableSize - 4;
+  assert( start<=iLast );
   while( (pbegin = get2byte(&data[addr]))<start && pbegin>0 ){
-    if( pbegin>iLast || pbegin<addr+4 ){
+    if( pbegin<addr+4 ){
       return SQLITE_CORRUPT_BKPT;
     }
     addr = pbegin;
@@ -7044,6 +7044,7 @@ int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){
   return rc;
 }
 
+#ifndef SQLITE_TEST
 /*
 ** Return the flag byte at the beginning of the page that the cursor
 ** is currently pointing to.
@@ -7060,6 +7061,7 @@ int sqlite3BtreeFlags(BtCursor *pCur){
   assert( pPage->pBt==pCur->pBt );
   return pPage->aData[pPage->hdrOffset];
 }
+#endif
 
 #ifndef SQLITE_OMIT_BTREECOUNT
 /*