/ Check-in [9278f7b1]
Login

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

Overview
Comment:The fix in (6395) was not correct. Fix #3756 a different way. (CVS 6397)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9278f7b1e1f2d0d4c2f8829ca801a769e512c2a6
User & Date: danielk1977 2009-03-28 10:54:23
Context
2009-03-28
15:04
Back out check-in (6380). Replace it with a proper fix to the xFullPathname method in the async VFS. (CVS 6398) check-in: 767a7f7b user: drh tags: trunk
10:54
The fix in (6395) was not correct. Fix #3756 a different way. (CVS 6397) check-in: 9278f7b1 user: danielk1977 tags: trunk
07:03
Fix a couple of test script bugs. No changes to SQLite code. (CVS 6396) check-in: c9fa329f user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** $Id: btree.c,v 1.578 2009/03/25 15:43:09 danielk1977 Exp $
           12  +** $Id: btree.c,v 1.579 2009/03/28 10:54:23 danielk1977 Exp $
    13     13   **
    14     14   ** This file implements a external (disk-based) database using BTrees.
    15     15   ** See the header comment on "btreeInt.h" for additional information.
    16     16   ** Including a description of file format and an overview of operation.
    17     17   */
    18     18   #include "btreeInt.h"
    19     19   
................................................................................
  4423   4423   
  4424   4424   #ifndef SQLITE_OMIT_AUTOVACUUM
  4425   4425       if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, *pPgno) ){
  4426   4426         /* If *pPgno refers to a pointer-map page, allocate two new pages
  4427   4427         ** at the end of the file instead of one. The first allocated page
  4428   4428         ** becomes a new pointer-map page, the second is used by the caller.
  4429   4429         */
         4430  +      MemPage *pPg = 0;
  4430   4431         TRACE(("ALLOCATE: %d from end of file (pointer-map page)\n", *pPgno));
  4431   4432         assert( *pPgno!=PENDING_BYTE_PAGE(pBt) );
         4433  +      rc = sqlite3BtreeGetPage(pBt, *pPgno, &pPg, 0);
         4434  +      if( rc==SQLITE_OK ){
         4435  +        rc = sqlite3PagerWrite(pPg->pDbPage);
         4436  +        releasePage(pPg);
         4437  +      }
         4438  +      if( rc ) return rc;
  4432   4439         (*pPgno)++;
  4433   4440         if( *pPgno==PENDING_BYTE_PAGE(pBt) ){ (*pPgno)++; }
  4434   4441       }
  4435   4442   #endif
  4436   4443   
  4437   4444       assert( *pPgno!=PENDING_BYTE_PAGE(pBt) );
  4438   4445       rc = sqlite3BtreeGetPage(pBt, *pPgno, ppPage, 0);

Changes to src/pager.c.

    14     14   ** The pager is used to access a database disk file.  It implements
    15     15   ** atomic commit and rollback through the use of a journal file that
    16     16   ** is separate from the database file.  The pager also implements file
    17     17   ** locking to prevent two processes from writing the same database
    18     18   ** file simultaneously, or one process from reading the database while
    19     19   ** another is writing.
    20     20   **
    21         -** @(#) $Id: pager.c,v 1.574 2009/03/28 06:59:41 danielk1977 Exp $
           21  +** @(#) $Id: pager.c,v 1.575 2009/03/28 10:54:23 danielk1977 Exp $
    22     22   */
    23     23   #ifndef SQLITE_OMIT_DISKIO
    24     24   #include "sqliteInt.h"
    25     25   
    26     26   /*
    27     27   ** Macros for troubleshooting.  Normally turned off
    28     28   */
................................................................................
  3427   3427     assert( pPager->state>=PAGER_SHARED && !MEMDB );
  3428   3428   
  3429   3429     if( !isOpen(pPager->fd) ){
  3430   3430       assert( pPager->tempFile );
  3431   3431       memset(pPg->pData, 0, pPager->pageSize);
  3432   3432       return SQLITE_OK;
  3433   3433     }
  3434         -
  3435   3434     iOffset = (pgno-1)*(i64)pPager->pageSize;
  3436   3435     rc = sqlite3OsRead(pPager->fd, pPg->pData, pPager->pageSize, iOffset);
  3437   3436     if( rc==SQLITE_IOERR_SHORT_READ ){
  3438         -    memset(pPg->pData, 0, pPager->pageSize);
  3439   3437       rc = SQLITE_OK;
  3440   3438     }
  3441   3439     if( pgno==1 ){
  3442   3440       u8 *dbFileVers = &((u8*)pPg->pData)[24];
  3443   3441       memcpy(&pPager->dbFileVers, dbFileVers, sizeof(pPager->dbFileVers));
  3444   3442     }
  3445   3443     CODEC1(pPager, pPg->pData, pgno, 3);