1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

sqlite3PCachePerecentDirty() should return 0 if the pcache is empty.

FossilOrigin-Name: 85f3d80eb7319754792eef76996b2c740a2b0073
This commit is contained in:
drh
2016-04-18 13:30:50 +00:00
parent 1454b26c17
commit b5895e50f9
3 changed files with 8 additions and 8 deletions

View File

@@ -695,7 +695,7 @@ int sqlite3PCachePercentDirty(PCache *pCache){
int nDirty = 0;
int nCache = numberOfCachePages(pCache);
for(pDirty=pCache->pDirty; pDirty; pDirty=pDirty->pDirtyNext) nDirty++;
return (int)(((i64)nDirty * 100) / nCache);
return nCache ? (int)(((i64)nDirty * 100) / nCache) : 0;
}
#if defined(SQLITE_CHECK_PAGES) || defined(SQLITE_DEBUG)