-C Fix\sthe\spager\sso\sthat\scorrect\srollbacks\soccur\swhen\ssynchronous\sis\sturned\soff.\r\nThis\scheck-in\salso\sincluded\sunrelated\sdocumentation\supdates.\s(CVS\s866)
-D 2003-02-15T23:09:17
+C Fix\smore\sbugs.\s\sThe\snew\srollback\sjournal\simplementation\snow\spasses\sall\nregression\stests\sunder\sLinux.\s(CVS\s867)
+D 2003-02-16T19:13:37
F Makefile.in 6606854b1512f185b8e8c779b8d7fc2750463d64
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
F src/md5.c fe4f9c9c6f71dfc26af8da63e4d04489b1430565
F src/os.c ed27e178e0c4b71f2807da81b8851f0fadc50778
F src/os.h afa3e096213bad86845f8bdca81a9e917505e401
-F src/pager.c bffccf853a20032d89b592572309ea8a15a7f3ed
+F src/pager.c 47509f6b2dbf1cba46e52602c1dacf04f9d66e10
F src/pager.h e5b8e301a732007766dc04880c764d7ee1aa34dd
F src/parse.y cdaed5009423d851708848bd279147c268e6022e
F src/printf.c f8fd911a8738f9b2eb07aca2870473d34707055d
F src/sqliteInt.h 2ae2c24fde8f7bb8040db964223d6e551e979358
F src/table.c eed2098c9b577aa17f8abe89313a9c4413f57d63
F src/tclsqlite.c 8167d40fd34036701e07492d07a6f9e5c4015241
-F src/test1.c eb05abd3ec6822f800476c04aed4db112690b144
+F src/test1.c 99add9d634a4e67790d71da02c12a83c69384697
F src/test2.c 5014337d8576b731cce5b5a14bec4f0daf432700
F src/test3.c c12ea7f1c3fbbd58904e81e6cb10ad424e6fc728
F src/threadtest.c d641a5219e718e18a1a80a50eb9bb549f451f42e
F test/misuse.test a3aa2b18a97e4c409a1fcaff5151a4dd804a0162
F test/notnull.test 7a08117a71e74b0321aaa937dbeb41a09d6eb1d0
F test/null.test 5c2b57307e4b6178aae825eb65ddbee01e76b0fd
-F test/pager.test d3a2e2f00999f97e056822a39d5ee2fad18bf12c
+F test/pager.test dd31da9bee94a82e2e87e58cf286cfe809f8fc5f
F test/pragma.test d45d130f532bfe86ebd5ba74862d88b36ded8998
F test/printf.test a29b8afa24edb4411adfe473b12ac32c84098fce
F test/quick.test b372c8dad4fa1554747e90683fc72e59c0c98502
F www/sqlite.tcl ae3dcfb077e53833b59d4fcc94d8a12c50a44098
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
-P dc53d92141c931fb133149355c3a1ea64030e676
-R 571b9c5813a6dfc27b61cc9c2ebc6b12
+P 3ef0ad8a4f2696a58aff9d812f90038c2c63f3fc
+R cc7da005c4e40adf620f5417209a13cc
U drh
-Z b201cdfd990195584437ce2ba1bc7248
+Z 54bed9eac4c6092a2059a4c6f2fdfdc6
-3ef0ad8a4f2696a58aff9d812f90038c2c63f3fc
\ No newline at end of file
+d10adc1c5727d76320d5919be55e86d030e9c8bc
\ No newline at end of file
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.77 2003/02/15 23:09:17 drh Exp $
+** @(#) $Id: pager.c,v 1.78 2003/02/16 19:13:37 drh Exp $
*/
#include "os.h" /* Must be first to enable large file support */
#include "sqliteInt.h"
u32 cksum;
rc = read32bits(format, jfd, &pgRec.pgno);
- if( rc!=SQLITE_OK ) return SQLITE_DONE;
+ if( rc!=SQLITE_OK ) return rc;
rc = sqliteOsRead(jfd, &pgRec.aData, sizeof(pgRec.aData));
- if( rc!=SQLITE_OK ) return SQLITE_DONE;
+ if( rc!=SQLITE_OK ) return rc;
/* Sanity checking on the page. This is more important that I originally
** thought. If a power failure occurs while the journal is being written,
}
if( format>=JOURNAL_FORMAT_3 ){
rc = read32bits(format, jfd, &cksum);
- if( rc ) return SQLITE_DONE;
+ if( rc ) return rc;
if( pager_cksum(pPager, pgRec.pgno, pgRec.aData)!=cksum ){
return SQLITE_DONE;
}
** at the same time, if there is one.
*/
pPg = pager_lookup(pPager, pgRec.pgno);
- if( pPg==0 || pPg->needSync==0 ){
- TRACE2("PLAYBACK %d\n", pgRec.pgno);
- sqliteOsSeek(&pPager->fd, (pgRec.pgno-1)*(off_t)SQLITE_PAGE_SIZE);
- rc = sqliteOsWrite(&pPager->fd, pgRec.aData, SQLITE_PAGE_SIZE);
- }
+ TRACE2("PLAYBACK %d\n", pgRec.pgno);
+ sqliteOsSeek(&pPager->fd, (pgRec.pgno-1)*(off_t)SQLITE_PAGE_SIZE);
+ rc = sqliteOsWrite(&pPager->fd, pgRec.aData, SQLITE_PAGE_SIZE);
if( pPg ){
if( pPg->nRef==0 ||
memcmp(PGHDR_TO_DATA(pPg), pgRec.aData, SQLITE_PAGE_SIZE)==0
** pPager->errMask and SQLITE_CORRUPT is returned. If it all
** works, then this routine returns SQLITE_OK.
*/
-static int pager_playback(Pager *pPager){
+static int pager_playback(Pager *pPager, int useJournalSize){
off_t szJ; /* Size of the journal file in bytes */
int nRec; /* Number of Records in the journal */
int i; /* Loop counter */
if( rc ) goto end_playback;
rc = read32bits(format, &pPager->jfd, &pPager->cksumInit);
if( rc ) goto end_playback;
- if( nRec==0xffffffff ){
+ if( nRec==0xffffffff || useJournalSize ){
nRec = (szJ - JOURNAL_HDR_SZ(3))/JOURNAL_PG_SZ(3);
}
}else{
if( rc!=0 ) return rc;
}
sqliteOsSeek(&pPager->jfd, sizeof(aJournalMagic1));
- write32bits(&pPager->jfd, pPager->nRec);
+ rc = write32bits(&pPager->jfd, pPager->nRec);
+ if( rc ) return rc;
szJ = JOURNAL_HDR_SZ(journal_format) +
pPager->nRec*JOURNAL_PG_SZ(journal_format);
sqliteOsSeek(&pPager->jfd, szJ);
/* Playback and delete the journal. Drop the database write
** lock and reacquire the read lock.
*/
- rc = pager_playback(pPager);
+ rc = pager_playback(pPager, 0);
if( rc!=SQLITE_OK ){
return rc;
}
if( journal_format>=JOURNAL_FORMAT_3 ){
*(u32*)PGHDR_TO_EXTRA(pPg) = saved;
}
- pPager->nRec++;
if( rc!=SQLITE_OK ){
sqlitepager_rollback(pPager);
pPager->errMask |= PAGER_ERR_FULL;
return rc;
}
+ pPager->nRec++;
assert( pPager->aInJournal!=0 );
pPager->aInJournal[pPg->pgno/8] |= 1<<(pPg->pgno&7);
pPg->needSync = !pPager->noSync;
if( pPager->errMask!=0 && pPager->errMask!=PAGER_ERR_FULL ){
if( pPager->state>=SQLITE_WRITELOCK ){
- pager_playback(pPager);
+ pager_playback(pPager, 1);
}
return pager_errcode(pPager);
}
if( pPager->state!=SQLITE_WRITELOCK ){
return SQLITE_OK;
}
- rc = pager_playback(pPager);
+ rc = pager_playback(pPager, 1);
if( rc!=SQLITE_OK ){
rc = SQLITE_CORRUPT;
pPager->errMask |= PAGER_ERR_CORRUPT;
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
-** $Id: test1.c,v 1.20 2003/01/29 22:58:26 drh Exp $
+** $Id: test1.c,v 1.21 2003/02/16 19:13:37 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
return TCL_OK;
}
+/*
+** Usage: breakpoint
+**
+** This routine exists for one purpose - to provide a place to put a
+** breakpoint with GDB that can be triggered using TCL code. The use
+** for this is when a particular test fails on (say) the 1485th iteration.
+** In the TCL test script, we can add code like this:
+**
+** if {$i==1485} breakpoint
+**
+** Then run testfixture in the debugger and wait for the breakpoint to
+** fire. Then additional breakpoints can be set to trace down the bug.
+*/
+static int test_breakpoint(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ return TCL_OK; /* Do nothing */
+}
+
/*
** Register commands with the TCL interpreter.
*/
{ "sqlite_compile", (Tcl_CmdProc*)test_compile },
{ "sqlite_step", (Tcl_CmdProc*)test_step },
{ "sqlite_finalize", (Tcl_CmdProc*)test_finalize },
+ { "breakpoint", (Tcl_CmdProc*)test_breakpoint },
};
int i;
# This file implements regression tests for SQLite library. The
# focus of this script is page cache subsystem.
#
-# $Id: pager.test,v 1.12 2003/01/11 14:19:52 drh Exp $
+# $Id: pager.test,v 1.13 2003/02/16 19:13:37 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
if {[info commands pager_open]!=""} {
+db close
# Basic sanity check. Open and close a pager.
#
lappend v $msg
} {0 {}}
do_test pager-2.29 {
+ page_unref $::g1
+ set ::g1 [page_get $::p1 1]
page_read $::g1
} {Page-One}
do_test pager-2.99 {