diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pager.c | 2 | ||||
-rw-r--r-- | src/pcache.c | 8 | ||||
-rw-r--r-- | src/pcache.h | 2 |
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 |