/ Check-in [8c046eb6]
Login

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

Overview
Comment:Candidate fix for a pager bug associated with sqlite3PagerMovepage().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8c046eb6d16682d5e755624deb4f76f57350b9c9
User & Date: drh 2010-04-09 15:34:06
Context
2010-04-09
23:05
Add a test case for the OOM-fault corruption issue. Ticket [9d68c883132c8]. check-in: 0a64a937 user: drh tags: trunk
15:34
Candidate fix for a pager bug associated with sqlite3PagerMovepage(). check-in: 8c046eb6 user: drh tags: trunk
09:14
Avoid unnecessary calls to sqlite3_step() with null prepared statements while parsing the schema. check-in: ae04d2d1 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  1504   1504     pPg = pager_lookup(pPager, pgno);
  1505   1505     assert( pPg || !MEMDB );
  1506   1506     PAGERTRACE(("PLAYBACK %d page %d hash(%08x) %s\n",
  1507   1507              PAGERID(pPager), pgno, pager_datahash(pPager->pageSize, (u8*)aData),
  1508   1508              (isMainJrnl?"main-journal":"sub-journal")
  1509   1509     ));
  1510   1510     if( (pPager->state>=PAGER_EXCLUSIVE)
  1511         -   && (pPg==0 || 0==(pPg->flags&PGHDR_NEED_SYNC))
         1511  +   && (!isSavepnt || pPg==0 || 0==(pPg->flags&PGHDR_NEED_SYNC))
  1512   1512      && isOpen(pPager->fd)
  1513   1513      && !isUnsync
  1514   1514     ){
  1515   1515       i64 ofst = (pgno-1)*(i64)pPager->pageSize;
         1516  +    testcase( !isSavepnt && pPg!=0 && (pPg->flags&PGHDR_NEED_SYNC)!=0 );
  1516   1517       rc = sqlite3OsWrite(pPager->fd, (u8*)aData, pPager->pageSize, ofst);
  1517   1518       if( pgno>pPager->dbFileSize ){
  1518   1519         pPager->dbFileSize = pgno;
  1519   1520       }
  1520   1521       if( pPager->pBackup ){
  1521   1522         CODEC1(pPager, aData, pgno, 3, rc=SQLITE_NOMEM);
  1522   1523         sqlite3BackupUpdate(pPager->pBackup, pgno, (u8*)aData);