SQLite

Check-in [a3540c6acf]
Login

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

Overview
Comment:When rolling back a savepoint to the beginning of the transaction, make sure to initialize the database size in the btree layer correctly even if the database size field of the header is zeroed.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a3540c6acf2bb6bdd44c101b63f17ca85e6b68ed
User & Date: drh 2010-04-07 20:29:56.000
Context
2010-04-08
01:16
Merge automatic index changes into the trunk. (check-in: bf7b8d8636 user: drh tags: trunk)
2010-04-07
20:32
Pull over the latest changes from the trunk. (check-in: e388fe8be8 user: drh tags: experimental)
20:29
When rolling back a savepoint to the beginning of the transaction, make sure to initialize the database size in the btree layer correctly even if the database size field of the header is zeroed. (check-in: a3540c6acf user: drh tags: trunk)
07:57
Add file test_demovfs.c, containing a simple VFS implementation that demonstrates how writes to the journal file may be safely buffered by the VFS layer to improve performance on some embedded systems. (check-in: af3b72d94a user: dan tags: trunk)
Changes
Unified Diff Show Whitespace Changes Patch
Changes to src/btree.c.
3276
3277
3278
3279
3280
3281
3282



3283
3284
3285
3286
3287
3288
3289
    assert( iSavepoint>=0 || (iSavepoint==-1 && op==SAVEPOINT_ROLLBACK) );
    sqlite3BtreeEnter(p);
    rc = sqlite3PagerSavepoint(pBt->pPager, op, iSavepoint);
    if( rc==SQLITE_OK ){
      if( iSavepoint<0 && pBt->initiallyEmpty ) pBt->nPage = 0;
      rc = newDatabase(pBt);
      pBt->nPage = get4byte(28 + pBt->pPage1->aData);



    }
    sqlite3BtreeLeave(p);
  }
  return rc;
}

/*







>
>
>







3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
    assert( iSavepoint>=0 || (iSavepoint==-1 && op==SAVEPOINT_ROLLBACK) );
    sqlite3BtreeEnter(p);
    rc = sqlite3PagerSavepoint(pBt->pPager, op, iSavepoint);
    if( rc==SQLITE_OK ){
      if( iSavepoint<0 && pBt->initiallyEmpty ) pBt->nPage = 0;
      rc = newDatabase(pBt);
      pBt->nPage = get4byte(28 + pBt->pPage1->aData);
      if( pBt->nPage==0 ){
        sqlite3PagerPagecount(pBt->pPager, (int*)&pBt->nPage);
      }
    }
    sqlite3BtreeLeave(p);
  }
  return rc;
}

/*