persistentstorage/sql/SQLite/pager.c
branchRCL_3
changeset 21 28839de615b4
parent 0 08ec8eefde2f
--- a/persistentstorage/sql/SQLite/pager.c	Mon Jun 21 17:37:53 2010 +0300
+++ b/persistentstorage/sql/SQLite/pager.c	Thu Aug 19 11:36:21 2010 +0300
@@ -3062,15 +3062,15 @@
     assert( p->dirty );
     p->dirty = 0;
   }
+
+  /* If the file has not yet been opened, open it now. */
+  if( !pPager->fd->pMethods ){
+    assert(pPager->tempFile);
+	rc = sqlite3PagerOpentemp(pPager, pPager->fd, pPager->vfsFlags);
+	if( rc ) return rc;
+  }
+
   while( pList ){
-
-    /* If the file has not yet been opened, open it now. */
-    if( !pPager->fd->pMethods ){
-      assert(pPager->tempFile);
-      rc = sqlite3PagerOpentemp(pPager, pPager->fd, pPager->vfsFlags);
-      if( rc ) return rc;
-    }
-
     /* If there are dirty pages in the page cache with page numbers greater
     ** than Pager.dbSize, this means sqlite3PagerTruncate() was called to
     ** make the file smaller (presumably by auto-vacuum code). Do not write
@@ -3655,7 +3655,7 @@
    || MEMDB
    || (pPager->lru.pFirstSynced==0 && pPager->doNotSync)
   ){
-    void *pData;
+    void *pData = 0;                   /* Initialized to placate warning */
     if( pPager->nPage>=pPager->nHash ){
       pager_resize_hash_table(pPager,
          pPager->nHash<256 ? 256 : pPager->nHash*2);