1
diff -u -r1.354 pager.c
2
--- pager.c 10 Aug 2007 23:56:36 -0000 1.354
3
+++ pager.c 11 Aug 2007 00:14:18 -0000
4
@@ -1455,10 +1451,15 @@
7
/* If nRec is 0 and this rollback is of a transaction created by this
8
- ** process. In this case the rest of the journal file consists of
9
- ** journalled copies of pages that need to be read back into the cache.
10
+ ** process and if this is the final header in the journal, then it means
11
+ ** that this part of the journal was being filled but has not yet been
12
+ ** synced to disk. Compute the number of pages based on the remaining
13
+ ** size of the file.
15
+ ** The third term of the test was added to fix ticket #2565.
17
- if( nRec==0 && !isHot ){
18
+ if( nRec==0 && !isHot &&
19
+ pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff ){
20
nRec = (szJ - pPager->journalOff) / JOURNAL_PG_SZ(pPager);
24
** very slow operation, so we work hard to avoid it. But sometimes
25
** it can't be helped.
27
- if( pPg==0 && pPager->pFirst && pPager->nRec && syncOk && !MEMDB){
28
+ if( pPg==0 && pPager->pFirst && syncOk && !MEMDB){
29
int rc = syncJournal(pPager);