persistentstorage/sql/SQLite/pager.c
changeset 41 3256212fc81f
parent 17 55f2396f6d25
equal deleted inserted replaced
35:0d6db0a14001 41:3256212fc81f
  3060   pList = sort_pagelist(pList);
  3060   pList = sort_pagelist(pList);
  3061   for(p=pList; p; p=p->pDirty){
  3061   for(p=pList; p; p=p->pDirty){
  3062     assert( p->dirty );
  3062     assert( p->dirty );
  3063     p->dirty = 0;
  3063     p->dirty = 0;
  3064   }
  3064   }
       
  3065 
       
  3066   /* If the file has not yet been opened, open it now. */
       
  3067   if( !pPager->fd->pMethods ){
       
  3068     assert(pPager->tempFile);
       
  3069 	rc = sqlite3PagerOpentemp(pPager, pPager->fd, pPager->vfsFlags);
       
  3070 	if( rc ) return rc;
       
  3071   }
       
  3072 
  3065   while( pList ){
  3073   while( pList ){
  3066 
       
  3067     /* If the file has not yet been opened, open it now. */
       
  3068     if( !pPager->fd->pMethods ){
       
  3069       assert(pPager->tempFile);
       
  3070       rc = sqlite3PagerOpentemp(pPager, pPager->fd, pPager->vfsFlags);
       
  3071       if( rc ) return rc;
       
  3072     }
       
  3073 
       
  3074     /* If there are dirty pages in the page cache with page numbers greater
  3074     /* If there are dirty pages in the page cache with page numbers greater
  3075     ** than Pager.dbSize, this means sqlite3PagerTruncate() was called to
  3075     ** than Pager.dbSize, this means sqlite3PagerTruncate() was called to
  3076     ** make the file smaller (presumably by auto-vacuum code). Do not write
  3076     ** make the file smaller (presumably by auto-vacuum code). Do not write
  3077     ** any such pages to the file.
  3077     ** any such pages to the file.
  3078     */
  3078     */