SQLite

Check-in [badaaa18fd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:The merge for check-in [415c448dc4] did not do exactly write, resulting in a subtle bug in the SQLITE_FCNTL_SIZE_HINT logic. This check-in is the fix.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA1: badaaa18fd4a4402add6ae1b3ecadbb79f91fe37
User & Date: drh 2010-09-09 23:31:37.000
Context
2010-09-09
23:40
Make sure MEMSTATUS is enabled at the beginning of the memsubsys2.test script. (check-in: cf23a35497 user: drh tags: apple-osx)
23:31
The merge for check-in [415c448dc4] did not do exactly write, resulting in a subtle bug in the SQLITE_FCNTL_SIZE_HINT logic. This check-in is the fix. (check-in: badaaa18fd user: drh tags: apple-osx)
2010-08-24
01:51
Merge in the R-tree fix from the trunk. (check-in: 02ee0bd5a3 user: drh tags: apple-osx)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/pager.c.
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
  ** is taken, as pager_wait_on_lock() is a no-op for temp-files.
  */
  if( !isOpen(pPager->fd) ){
    assert( pPager->tempFile && rc==SQLITE_OK );
    rc = pagerOpentemp(pPager, pPager->fd, pPager->vfsFlags);
  }

#if 0
  /* Before the first write, give the VFS a hint of what the final
  ** file size will be.
  */
  assert( rc!=SQLITE_OK || isOpen(pPager->fd) );
  if( rc==SQLITE_OK && pPager->dbSize>pPager->dbHintSize ){
    sqlite3_int64 szFile = pPager->pageSize * (sqlite3_int64)pPager->dbSize;
    sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SIZE_HINT, &szFile);
  }
#endif

  /* Before the first write, give the VFS a hint of what the final
  ** file size will be.
  */
  if( rc==SQLITE_OK
   && pPager->dbSize>(pPager->dbFileSize+1)
   && isOpen(pPager->fd)
  ){
    sqlite3_int64 szFile = pPager->pageSize * (sqlite3_int64)pPager->dbSize;
    sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SIZE_HINT, &szFile);
    pPager->dbHintSize = pPager->dbSize;
  }

  while( rc==SQLITE_OK && pList ){
    Pgno pgno = pList->pgno;







<





<
<
<
<
<
<
<
<
<
<
<
<







3904
3905
3906
3907
3908
3909
3910

3911
3912
3913
3914
3915












3916
3917
3918
3919
3920
3921
3922
  ** is taken, as pager_wait_on_lock() is a no-op for temp-files.
  */
  if( !isOpen(pPager->fd) ){
    assert( pPager->tempFile && rc==SQLITE_OK );
    rc = pagerOpentemp(pPager, pPager->fd, pPager->vfsFlags);
  }


  /* Before the first write, give the VFS a hint of what the final
  ** file size will be.
  */
  assert( rc!=SQLITE_OK || isOpen(pPager->fd) );
  if( rc==SQLITE_OK && pPager->dbSize>pPager->dbHintSize ){












    sqlite3_int64 szFile = pPager->pageSize * (sqlite3_int64)pPager->dbSize;
    sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SIZE_HINT, &szFile);
    pPager->dbHintSize = pPager->dbSize;
  }

  while( rc==SQLITE_OK && pList ){
    Pgno pgno = pList->pgno;