SQLite

Check-in [88810cd091]
Login

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

Overview
Comment:Put an ALWAYS() around a condition in pcache.c that must always be true in the current implementation.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 88810cd091b33f2c56f842e32cafbac5d34d7412
User & Date: drh 2010-03-19 19:23:52.000
Context
2010-03-22
04:32
Change the formatting of the preprocessor macros surrounding the compileoption interface in sqlite.h.in. This is so the documentation produced by parsing this part of sqlite.h.in is formatted similarly to the docs for the deprecated interfaces (with the #ifndef visible on the webpage). (check-in: 161958d11f user: dan tags: trunk)
2010-03-19
19:23
Put an ALWAYS() around a condition in pcache.c that must always be true in the current implementation. (check-in: 88810cd091 user: drh tags: trunk)
19:02
Have the xUpdate() method of the rtree module virtual table implementation set the *pRowid output variable when inserting a row. Fix for [dd3ba6063a]. (check-in: f31d22489d user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/pcache.c.
403
404
405
406
407
408
409




410

411
412
413
414
415
416
417
*/
void sqlite3PcacheTruncate(PCache *pCache, Pgno pgno){
  if( pCache->pCache ){
    PgHdr *p;
    PgHdr *pNext;
    for(p=pCache->pDirty; p; p=pNext){
      pNext = p->pDirtyNext;




      if( p->pgno>pgno ){

        assert( p->flags&PGHDR_DIRTY );
        sqlite3PcacheMakeClean(p);
      }
    }
    if( pgno==0 && pCache->pPage1 ){
      memset(pCache->pPage1->pData, 0, pCache->szPage);
      pgno = 1;







>
>
>
>
|
>







403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
*/
void sqlite3PcacheTruncate(PCache *pCache, Pgno pgno){
  if( pCache->pCache ){
    PgHdr *p;
    PgHdr *pNext;
    for(p=pCache->pDirty; p; p=pNext){
      pNext = p->pDirtyNext;
      /* This routine never gets call with a positive pgno except right
      ** after sqlite3PcacheCleanAll().  So if there are dirty pages,
      ** it must be that pgno==0.
      */
      assert( p->pgno>0 );
      if( ALWAYS(p->pgno>pgno) ){
        assert( p->flags&PGHDR_DIRTY );
        sqlite3PcacheMakeClean(p);
      }
    }
    if( pgno==0 && pCache->pPage1 ){
      memset(pCache->pPage1->pData, 0, pCache->szPage);
      pgno = 1;