/ Check-in [9ff8598f]
Login

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

Overview
Comment:Fix a (benign) valgrind error that can occur following malloc failure while executing a 'ROLLBACK TO savepoint' command. (CVS 6096)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9ff8598f3be123a244f71b45e77af913b836504a
User & Date: danielk1977 2009-01-01 15:20:37
Context
2009-01-02
01:10
Do not display matches against the right-hand side of a NOT operator in the output of the FTS snippet() or offsets() functions. (CVS 6097) check-in: d44c84c0 user: drh tags: trunk
2009-01-01
15:20
Fix a (benign) valgrind error that can occur following malloc failure while executing a 'ROLLBACK TO savepoint' command. (CVS 6096) check-in: 9ff8598f user: danielk1977 tags: trunk
14:06
Fix some problems in the fts3 expression parser with mismatched parenthesis. (CVS 6095) check-in: ccfe4580 user: danielk1977 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.524 2008/12/27 15:23:13 danielk1977 Exp $
           21  +** @(#) $Id: pager.c,v 1.525 2009/01/01 15:20:37 danielk1977 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   */
................................................................................
  1692   1692         rc = pager_playback_one_page(pPager, 1, pPager->journalOff, 1, pDone);
  1693   1693         assert( rc!=SQLITE_DONE );
  1694   1694       }
  1695   1695     }else{
  1696   1696       pPager->journalOff = 0;
  1697   1697     }
  1698   1698     while( rc==SQLITE_OK && pPager->journalOff<szJ ){
  1699         -    u32 nJRec;         /* Number of Journal Records */
         1699  +    u32 nJRec = 0;     /* Number of Journal Records */
  1700   1700       u32 dummy;
  1701   1701       rc = readJournalHdr(pPager, szJ, &nJRec, &dummy);
  1702   1702       assert( rc!=SQLITE_DONE );
  1703   1703       if( nJRec==0 ){
  1704   1704         nJRec = (szJ - pPager->journalOff) / (pPager->pageSize+8);
  1705   1705       }
  1706   1706       for(ii=0; rc==SQLITE_OK && ii<nJRec && pPager->journalOff<szJ; ii++){

Changes to test/savepoint3.test.

     5      5   #
     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12         -# $Id: savepoint3.test,v 1.1 2008/12/18 18:31:39 danielk1977 Exp $
           12  +# $Id: savepoint3.test,v 1.2 2009/01/01 15:20:37 danielk1977 Exp $
    13     13   
    14     14   set testdir [file dirname $argv0]
    15     15   source $testdir/tester.tcl
    16     16   
    17     17   source $testdir/malloc_common.tcl
    18     18   
    19     19   do_malloc_test savepoint3-1 -sqlprep {
................................................................................
    24     24       INSERT INTO t1 VALUES(4, 5, 6);
    25     25       SAVEPOINT two;
    26     26         DELETE FROM t1;
    27     27       ROLLBACK TO two;
    28     28     RELEASE one;
    29     29   }
    30     30   
    31         -do_malloc_test savepoint3-1 -sqlprep {
           31  +do_malloc_test savepoint3-2 -sqlprep {
    32     32     PRAGMA cache_size = 10;
    33     33     CREATE TABLE t1(a, b, c);
    34     34     INSERT INTO t1 VALUES(randstr(400,400), randstr(400,400), randstr(400,400));
    35     35     INSERT INTO t1 SELECT 
    36     36       randstr(400,400), randstr(400,400), randstr(400,400) FROM t1;
    37     37     INSERT INTO t1 
    38     38       SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1;