aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-05-12 12:08:48 +0000
committerdrh <drh@noemail.net>2016-05-12 12:08:48 +0000
commit91ef8ad42ceee04388ba471dfc8482ccaed91cc2 (patch)
tree8b41393ed119c7d78bdf0120212a08cd1e07ae85 /src
parent42bee5f4d6cefc9e467d6c7203a530f815e42b36 (diff)
parent72e6a399073fd63bb5e8bc1db07a95365d2a2e2b (diff)
downloadsqlite-91ef8ad42ceee04388ba471dfc8482ccaed91cc2.tar.gz
sqlite-91ef8ad42ceee04388ba471dfc8482ccaed91cc2.zip
For in-memory databases, it does not matter if pcache entries are marked
"clean" or "writable". FossilOrigin-Name: 06c1e27ca868f247f8c27b03eb19aac004f28650
Diffstat (limited to 'src')
-rw-r--r--src/pager.c2
-rw-r--r--src/pcache.c8
-rw-r--r--src/pcache.h2
3 files changed, 9 insertions, 3 deletions
diff --git a/src/pager.c b/src/pager.c
index 654cc640d..75cde3c02 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -2033,7 +2033,7 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){
pPager->pInJournal = 0;
pPager->nRec = 0;
if( rc==SQLITE_OK ){
- if( MEMDB || pagerFlushOnCommit(pPager) ){
+ if( pagerFlushOnCommit(pPager) ){
sqlite3PcacheCleanAll(pPager->pPCache);
}else{
sqlite3PcacheClearWritable(pPager->pPCache);
diff --git a/src/pcache.c b/src/pcache.c
index fab6ad32a..ee7914a44 100644
--- a/src/pcache.c
+++ b/src/pcache.c
@@ -14,7 +14,13 @@
#include "sqliteInt.h"
/*
-** A complete page cache is an instance of this structure.
+** A complete page cache is an instance of this structure. Every
+** entry in the cache holds a single page of the database file. The
+** btree layer only operates on the cached copy of the database pages.
+**
+** A page cache entry is "clean" if it exactly matches what is currently
+** on disk. A page is "dirty" if it has been modified and needs to be
+** persisted to disk.
**
** pDirty, pDirtyTail, pSynced:
** All dirty pages are linked into the doubly linked list using
diff --git a/src/pcache.h b/src/pcache.h
index 04bce289d..8e0f12e09 100644
--- a/src/pcache.h
+++ b/src/pcache.h
@@ -26,7 +26,7 @@ struct PgHdr {
sqlite3_pcache_page *pPage; /* Pcache object page handle */
void *pData; /* Page data */
void *pExtra; /* Extra content */
- PgHdr *pDirty; /* Transient list of dirty pages */
+ PgHdr *pDirty; /* Transient list of dirty sorted by pgno */
Pager *pPager; /* The pager this page is part of */
Pgno pgno; /* Page number for this page */
#ifdef SQLITE_CHECK_PAGES