/ Check-in [38083228]
Login

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

Overview
Comment:Remove an ALWAYS() from a condition that can in fact be false under very obscure circumstances. (CVS 6918)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 38083228956ac05df45f44447ab39c64852239d2
User & Date: drh 2009-07-22 02:02:40
Context
2009-07-22
07:27
Changes to test code (only) to allow veryquick.test to run with OMIT_UTF16 builsd. Ticket #3985. (CVS 6919) check-in: 7f3fc7f2 user: danielk1977 tags: trunk
02:02
Remove an ALWAYS() from a condition that can in fact be false under very obscure circumstances. (CVS 6918) check-in: 38083228 user: drh tags: trunk
00:35
Further simplifications to btree.c, especially the sqlite3BtreeKey() and sqlite3BtreeData() functions. New assert() statements added to verify that these routines are called correctly. (CVS 6917) check-in: 96cfd079 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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.610 2009/07/21 19:25:24 danielk1977 Exp $
           21  +** @(#) $Id: pager.c,v 1.611 2009/07/22 02:02:40 drh 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   */
................................................................................
  5201   5201     ** from its hash chain. Also, if the PgHdr.needSync was set for 
  5202   5202     ** page pgno before the 'move' operation, it needs to be retained 
  5203   5203     ** for the page moved there.
  5204   5204     */
  5205   5205     pPg->flags &= ~PGHDR_NEED_SYNC;
  5206   5206     pPgOld = pager_lookup(pPager, pgno);
  5207   5207     assert( !pPgOld || pPgOld->nRef==1 );
  5208         -  if( ALWAYS(pPgOld) ){
         5208  +  if( pPgOld ){
  5209   5209       pPg->flags |= (pPgOld->flags&PGHDR_NEED_SYNC);
  5210   5210       sqlite3PcacheDrop(pPgOld);
  5211   5211     }
  5212   5212   
  5213   5213     origPgno = pPg->pgno;
  5214   5214     sqlite3PcacheMove(pPg, pgno);
  5215   5215     sqlite3PcacheMakeDirty(pPg);