]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Btree checks the autovacuum flag after locking the database file. (CVS 2341)
authordrh <drh@noemail.net>
Tue, 15 Feb 2005 16:23:02 +0000 (16:23 +0000)
committerdrh <drh@noemail.net>
Tue, 15 Feb 2005 16:23:02 +0000 (16:23 +0000)
FossilOrigin-Name: 6610188f09d08c65c46a140685b403aa74f71a19

manifest
manifest.uuid
src/btree.c

index c3746b39cabb6a691b603374e71a3610a23985ab..a824ec66092793c20c4947dae418a29953393161 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Append\sthe\sversion\snumber\sto\sthe\sdirectory\sname\sin\ssource\scode\starballs.\nTickets\s#793,\s#855,\sand\s#1055.\s(CVS\s2340)
-D 2005-02-15T16:15:10
+C Btree\schecks\sthe\sautovacuum\sflag\safter\slocking\sthe\sdatabase\sfile.\s(CVS\s2341)
+D 2005-02-15T16:23:02
 F Makefile.in d928187101fa3d78426cf48ca30e39d0fb714e57
 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
 F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
@@ -29,7 +29,7 @@ F sqlite3.def dbaeb20c153e1d366e8f421b55a573f5dfc00863
 F sqlite3.pc.in 985b9bf34192a549d7d370e0f0b6b34a4f61369a
 F src/attach.c f78f76bc6a8e5e487ca53636e21ccba2484a9a61
 F src/auth.c 18c5a0befe20f3a58a41e3ddd78f372faeeefe1f
-F src/btree.c 2432adf957c68e7243b198c174b0f316f9717844
+F src/btree.c 5c6e81855deec3d1eac5ae03e4c8db6c2595421f
 F src/btree.h 2e2cc923224649337d7217df0dd32b06673ca180
 F src/build.c 09333b6006d26d411dbaa918601be1054c09fff3
 F src/date.c f3d1f5cd1503dabf426a198f3ebef5afbc122a7f
@@ -271,7 +271,7 @@ F www/tclsqlite.tcl e73f8f8e5f20e8277619433f7970060ab01088fc
 F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
 F www/whentouse.tcl 3e522a06ad41992023c80ca29a048ae2331ca5bd
-P 9fd9d9fbeefcc76e7262f488f99ac11eaf58e88e
-R a2fd2a4c1c603dd3a01028da57d54289
+P 138577d0a5c41f3de4f9adc9ab6e312a65ff8888
+R f81718102e4042ffed922f8685264bda
 U drh
-Z c969f213578d828c413220b331345b06
+Z ba532001e1e18d6f4d6553ba708c367b
index 415623534b36e7e19781c0979d9a8ca7da2bc5de..f365ab42d70ba40117df33027361694ac584301d 100644 (file)
@@ -1 +1 @@
-138577d0a5c41f3de4f9adc9ab6e312a65ff8888
\ No newline at end of file
+6610188f09d08c65c46a140685b403aa74f71a19
\ No newline at end of file
index 49e817c554a64c543fe061c6a48e98ab9c1223a0..1a5062a6e6c8f8eff46c892608ea85590aad81fb 100644 (file)
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.247 2005/02/12 08:59:56 danielk1977 Exp $
+** $Id: btree.c,v 1.248 2005/02/15 16:23:02 drh Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** For a detailed discussion of BTrees, refer to
@@ -304,6 +304,9 @@ struct Btree {
   u8 minEmbedFrac;      /* Minimum payload as % of total page size */
   u8 minLeafFrac;       /* Minimum leaf payload as % of total page size */
   u8 pageSizeFixed;     /* True if the page size can no longer be changed */
+#ifndef SQLITE_OMIT_AUTOVACUUM
+  u8 autoVacuum;        /* True if database supports auto-vacuum */
+#endif
   u16 pageSize;         /* Total number of bytes on a page */
   u16 psAligned;        /* pageSize rounded up to a multiple of 8 */
   u16 usableSize;       /* Number of usable bytes on each page */
@@ -311,9 +314,6 @@ struct Btree {
   int minLocal;         /* Minimum local payload in non-LEAFDATA tables */
   int maxLeaf;          /* Maximum local payload in a LEAFDATA table */
   int minLeaf;          /* Minimum local payload in a LEAFDATA table */
-#ifndef SQLITE_OMIT_AUTOVACUUM
-  u8 autoVacuum;        /* True if database supports auto-vacuum */
-#endif
 };
 typedef Btree Bt;
 
@@ -1444,6 +1444,9 @@ static int lockBtree(Btree *pBt){
     pBt->maxEmbedFrac = page1[21];
     pBt->minEmbedFrac = page1[22];
     pBt->minLeafFrac = page1[23];
+#ifndef SQLITE_OMIT_AUTOVACUUM
+    pBt->autoVacuum = (get4byte(&page1[36 + 4*4])?1:0);
+#endif
   }
 
   /* maxLocal is the maximum amount of payload to store locally for
@@ -1926,25 +1929,6 @@ static int countWriteCursors(Btree *pBt){
 }
 #endif
 
-#if 0
-/*
-** Invalidate all cursors
-*/
-static void invalidateCursors(Btree *pBt){
-  BtCursor *pCur;
-  for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){
-    MemPage *pPage = pCur->pPage;
-    if( pPage /* && !pPage->isInit */ ){
-      pageIntegrity(pPage);
-      releasePage(pPage);
-      pCur->pPage = 0;
-      pCur->isValid = 0;
-      pCur->status = SQLITE_ABORT;
-    }
-  }
-}
-#endif
-
 #ifdef SQLITE_TEST
 /*
 ** Print debugging information about all cursors to standard output.