/ Check-in [15d88edf]
Login

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

Overview
Comment:Port the corruption bug fix of check-in (5938) into a branch off of version 3.6.6. (CVS 5947)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch_3_6_6
Files: files | file ages | folders
SHA1: 15d88edf7671822c57238c3f85adf0b40b13e3e2
User & Date: drh 2008-11-22 14:07:49
Original Comment: Port the corruption bug fix of check-in (5938) into a branch off of version 3.6.6. (CVS 5947)
Context
2008-11-22
15:51
Version 3.6.6.1 (CVS 5948) check-in: c2266aa0 user: drh tags: branch_3_6_6
14:07
Port the corruption bug fix of check-in (5938) into a branch off of version 3.6.6. (CVS 5947) check-in: 15d88edf user: drh tags: branch_3_6_6
2008-11-20
18:20
When a memory allocation fails on the %Q conversion in sqlite3_mprintf(), make sure the error is reported back up the call stack. (CVS 5933) check-in: eebacbc9 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to VERSION.

     1         -3.6.6
            1  +3.6.6.1

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.539 2008/11/19 10:22:33 danielk1977 Exp $
           12  +** $Id: btree.c,v 1.539.2.1 2008/11/22 14:07:49 drh 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   
................................................................................
  4300   4300     }
  4301   4301   
  4302   4302     assert( *pPgno!=PENDING_BYTE_PAGE(pBt) );
  4303   4303   
  4304   4304   end_allocate_page:
  4305   4305     releasePage(pTrunk);
  4306   4306     releasePage(pPrevTrunk);
  4307         -  if( rc==SQLITE_OK && sqlite3PagerPageRefcount((*ppPage)->pDbPage)>1 ){
  4308         -    releasePage(*ppPage);
  4309         -    return SQLITE_CORRUPT_BKPT;
         4307  +  if( rc==SQLITE_OK ){
         4308  +    if( sqlite3PagerPageRefcount((*ppPage)->pDbPage)>1 ){
         4309  +      releasePage(*ppPage);
         4310  +      return SQLITE_CORRUPT_BKPT;
         4311  +    }
         4312  +    (*ppPage)->isInit = 0;
  4310   4313     }
  4311   4314     return rc;
  4312   4315   }
  4313   4316   
  4314   4317   /*
  4315   4318   ** Add a page of the database file to the freelist.
  4316   4319   **