From: danielk1977 Date: Sat, 23 Aug 2008 18:53:08 +0000 (+0000) Subject: Instead of marking a page as clean when sqlite3PagerDontWrite() is called, set a... X-Git-Tag: version-3.6.10~573 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33e3216a3d633e28e40171399abf098132dddcd1;p=thirdparty%2Fsqlite.git Instead of marking a page as clean when sqlite3PagerDontWrite() is called, set a dedictated flag - PGHDR_DONT_WRITE. (CVS 5604) FossilOrigin-Name: a323bd29a600abddbcc2cc9961ab84d82cccc5e5 --- diff --git a/manifest b/manifest index 7092a10367..477707ada6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Do\snot\sincorrectly\sdetect\scorruption\swhen\san\sauto-vacuum\sdatabase\sis\sconverted\sto\sa\snon-auto-vacuum\sdatabase\swithin\sa\svacuum.\sTicket\s#3332.\s(CVS\s5603) -D 2008-08-23T16:17:56 +C Instead\sof\smarking\sa\spage\sas\sclean\swhen\ssqlite3PagerDontWrite()\sis\scalled,\sset\sa\sdedictated\sflag\s-\sPGHDR_DONT_WRITE.\s(CVS\s5604) +D 2008-08-23T18:53:08 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 689e14735f862a5553bceef206d8c13e29504e44 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -135,11 +135,11 @@ F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60 F src/os_os2.c e391fc95adc744bbdcefd4d11e3066998185a0a0 F src/os_unix.c 4665cef7639dd937893c3ea076f0e8a8f215bb32 F src/os_win.c aefe9ee26430678a19a058a874e4e2bd91398142 -F src/pager.c 62a0e18d5daacc9c0b3c79d446d411051fbfe6a2 +F src/pager.c 8fd88689463dcf2ee1d687e6cb0a8c3d3c9b7647 F src/pager.h 3b9c138d2e744b9d6e61d4c2742301e3bf464864 F src/parse.y d0f76d2cb8d6883d5600dc20beb961a6022b94b8 -F src/pcache.c 3feb47f5ce4174570e7b76bd851faccf7df55e80 -F src/pcache.h 1457e4e7ef08f6964399d5c039afdece25071d54 +F src/pcache.c 4858bf42f9c04c1d1f767c1f2a052809836db6ad +F src/pcache.h f03fc3b8241da092bd929ba0eec15e84d9d2cca0 F src/pragma.c f5b271b090af7fcedd308d7c5807a5503f7a853d F src/prepare.c c197041e0c4770672cda75e6bfe10242f885e510 F src/printf.c 785f87120589c1db672e37c6eb1087c456e6f84d @@ -623,7 +623,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P f8a70501c234545b3030144ac6bcbfaa0d2b0069 -R aef83607149c9c342bce05a1b1fbac8b +P cb869946d68f2abbd1322fababbe4aa74a4e08aa +R 6bb49f025f936fb67884362dcf5dfa8b U danielk1977 -Z 1527ca57bd02efd33a253e2eb002c3ed +Z aad391fe05cc3c31b11ee3817a80c513 diff --git a/manifest.uuid b/manifest.uuid index 07d14badb7..0201551861 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -cb869946d68f2abbd1322fababbe4aa74a4e08aa \ No newline at end of file +a323bd29a600abddbcc2cc9961ab84d82cccc5e5 \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index aebf9f8a4f..c47ab44652 100644 --- a/src/pager.c +++ b/src/pager.c @@ -18,7 +18,7 @@ ** file simultaneously, or one process from reading the database while ** another is writing. ** -** @(#) $Id: pager.c,v 1.476 2008/08/22 17:34:45 drh Exp $ +** @(#) $Id: pager.c,v 1.477 2008/08/23 18:53:08 danielk1977 Exp $ */ #ifndef SQLITE_OMIT_DISKIO #include "sqliteInt.h" @@ -2401,7 +2401,7 @@ static int pager_write_pagelist(PgHdr *pList){ ** make the file smaller (presumably by auto-vacuum code). Do not write ** any such pages to the file. */ - if( pList->pgno<=pPager->dbSize ){ + if( pList->pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){ i64 offset = (pList->pgno-1)*(i64)pPager->pageSize; char *pData = CODEC2(pPager, pList->pData, pList->pgno, 6); PAGERTRACE4("STORE %d page %d hash(%08x)\n", @@ -2857,7 +2857,6 @@ static int pagerAcquire( */ int nMax; PAGER_INCR(pPager->nMiss); - /* pPager->nRef++; */ pPg->pPager = pPager; if( sqlite3BitvecTest(pPager->pInJournal, pgno) ){ pPg->flags |= PGHDR_IN_JOURNAL; @@ -3495,7 +3494,7 @@ void sqlite3PagerDontWrite(DbPage *pDbPage){ }else{ PAGERTRACE3("DONT_WRITE page %d of %d\n", pPg->pgno, PAGERID(pPager)); IOTRACE(("CLEAN %p %d\n", pPager, pPg->pgno)) - makeClean(pPg); + pPg->flags |= PGHDR_DONT_WRITE; #ifdef SQLITE_CHECK_PAGES pPg->pageHash = pager_pagehash(pPg); #endif diff --git a/src/pcache.c b/src/pcache.c index 84bf0994a7..4c4d2538f2 100644 --- a/src/pcache.c +++ b/src/pcache.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file implements that page cache. ** -** @(#) $Id: pcache.c,v 1.10 2008/08/22 17:34:45 drh Exp $ +** @(#) $Id: pcache.c,v 1.11 2008/08/23 18:53:08 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -739,6 +739,7 @@ void sqlite3PcacheDrop(PgHdr *p){ void sqlite3PcacheMakeDirty(PgHdr *p){ PCache *pCache; assert( p->pCache->iInUseDB ); + p->flags &= ~PGHDR_DONT_WRITE; if( p->flags & PGHDR_DIRTY ) return; assert( (p->flags & PGHDR_DIRTY)==0 ); assert( p->nRef>0 ); diff --git a/src/pcache.h b/src/pcache.h index e55260d71d..0a59d1d8b7 100644 --- a/src/pcache.h +++ b/src/pcache.h @@ -12,7 +12,7 @@ ** This header file defines the interface that the sqlite page cache ** subsystem. ** -** @(#) $Id: pcache.h,v 1.4 2008/08/22 16:22:17 danielk1977 Exp $ +** @(#) $Id: pcache.h,v 1.5 2008/08/23 18:53:08 danielk1977 Exp $ */ #ifndef _PCACHE_H_ @@ -52,7 +52,7 @@ struct PgHdr { #define PGHDR_NEED_READ 0x020 /* Content is unread */ #define PGHDR_IS_INIT 0x040 /* pData is initialized */ #define PGHDR_REUSE_UNLIKELY 0x080 /* Hint: Reuse is unlikely */ - +#define PGHDR_DONT_WRITE 0x100 /* Do not write content to disk */ /* Initialize and shutdown the page cache subsystem */ int sqlite3PcacheInitialize(void);