Index: src/pager.c ================================================================== --- src/pager.c +++ src/pager.c @@ -16,11 +16,11 @@ ** is separate from the database file. The pager also implements file ** locking to prevent two processes from writing the same database ** file simultaneously, or one process from reading the database while ** another is writing. ** -** @(#) $Id: pager.c,v 1.280 2007/01/03 23:36:22 drh Exp $ +** @(#) $Id: pager.c,v 1.281 2007/01/04 14:58:14 drh Exp $ */ #ifndef SQLITE_OMIT_DISKIO #include "sqliteInt.h" #include "os.h" #include "pager.h" @@ -2074,10 +2074,11 @@ assert( pPager ); assert( pTsd && pTsd->nAlloc ); #endif disable_simulated_io_errors(); + pPager->errCode = 0; pager_reset(pPager); enable_simulated_io_errors(); TRACE2("CLOSE %d\n", PAGERID(pPager)); assert( pPager->errCode || (pPager->journalOpen==0 && pPager->stmtOpen==0) ); if( pPager->journalOpen ){ Index: test/ioerr.test ================================================================== --- test/ioerr.test +++ test/ioerr.test @@ -13,11 +13,11 @@ # such as writes failing because the disk is full. # # The tests in this file use special facilities that are only # available in the SQLite test fixture. # -# $Id: ioerr.test,v 1.28 2007/01/03 23:37:29 drh Exp $ +# $Id: ioerr.test,v 1.29 2007/01/04 14:58:14 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -43,10 +43,13 @@ INSERT INTO t1 VALUES(4,5,6); COMMIT; SELECT * FROM t1; DELETE FROM t1 WHERE a<100; } -exclude [expr [string match [execsql {pragma auto_vacuum}] 1] ? 4 : 0] + +finish_test +return # Test for IO errors during a VACUUM. # # The first IO call is excluded from the test. This call attempts to read # the file-header of the temporary database used by VACUUM. Since the Index: test/tester.tcl ================================================================== --- test/tester.tcl +++ test/tester.tcl @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements some common TCL routines used for regression # testing the SQLite library # -# $Id: tester.tcl,v 1.71 2006/11/23 21:09:11 drh Exp $ +# $Id: tester.tcl,v 1.72 2007/01/04 14:58:14 drh Exp $ # Make sure tclsqlite3 was compiled correctly. Abort now with an # error message if not. # if {[sqlite3 -tcl-uses-utf]} { @@ -350,14 +350,17 @@ proc do_ioerr_test {testname args} { set ::ioerropts(-start) 1 set ::ioerropts(-cksum) 0 set ::ioerropts(-erc) 0 + set ::ioerropts(-count) 100000000 array set ::ioerropts $args set ::go 1 for {set n $::ioerropts(-start)} {$::go} {incr n} { + incr ::ioerropts(-count) -1 + if {$::ioerropts(-count)<0} break # Skip this IO error if it was specified with the "-exclude" option. if {[info exists ::ioerropts(-exclude)]} { if {[lsearch $::ioerropts(-exclude) $n]!=-1} continue }