~ubuntu-branches/ubuntu/hardy/sqlite3/hardy

« back to all changes in this revision

Viewing changes to src/patch1

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2007-08-20 16:12:00 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20070820161200-1u06zme8ghkyaenn
Tags: 3.4.2-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 @@
 
5
     }
 
6
 
 
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.
 
14
+    **
 
15
+    ** The third term of the test was added to fix ticket #2565.
 
16
     */
 
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);
 
21
     }
 
22
 
 
23
@@ -2629,7 +2630,7 @@
 
24
   ** very slow operation, so we work hard to avoid it.  But sometimes
 
25
   ** it can't be helped.
 
26
   */
 
27
-  if( pPg==0 && pPager->pFirst && pPager->nRec && syncOk && !MEMDB){
 
28
+  if( pPg==0 && pPager->pFirst && syncOk && !MEMDB){
 
29
     int rc = syncJournal(pPager);
 
30
     if( rc!=0 ){
 
31
       return rc;