From: danielk1977 Date: Wed, 7 Jan 2009 18:08:48 +0000 (+0000) Subject: Make the same change as (6121) (accidentally reverted). Also enhance test_journal... X-Git-Tag: version-3.6.10~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f70c1fee96277fca05333082ad8d7515a0af8565;p=thirdparty%2Fsqlite.git Make the same change as (6121) (accidentally reverted). Also enhance test_journal.c to catch this kind of bug. (CVS 6136) FossilOrigin-Name: ccc9c211a285fd4da68b69e15594f080371be522 --- diff --git a/manifest b/manifest index 3fb5d05d62..3390a59fd5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\s"synchronous\s=\soff"\svariant\sto\ssavepoint6.test.\s(CVS\s6135) -D 2009-01-07T17:06:53 +C Make\sthe\ssame\schange\sas\s(6121)\s(accidentally\sreverted).\sAlso\senhance\stest_journal.c\sto\scatch\sthis\skind\sof\sbug.\s(CVS\s6136) +D 2009-01-07T18:08:49 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 05461a9b5803d5ad10c79f989801e9fd2cc3e592 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -142,7 +142,7 @@ F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60 F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5 F src/os_unix.c e6eacc7ec735ded605fefcbaf250058baa8feb12 F src/os_win.c 496e3ceb499aedc63622a89ef76f7af2dd902709 -F src/pager.c 2fd6d5a88a8a2a7222398640d88d0094a221b240 +F src/pager.c 76d62924b6547eeff64ce8b9ecec26f74c3dcf33 F src/pager.h 9870acb2d653848d90d765d7cbf163496d6c8111 F src/parse.y 4d0e33a702dc3ea7b69d8ae1914b3fbd32e46057 F src/pcache.c 16dc8da6e6ba6250f8dfd9ee46036db1cbceedc6 @@ -179,7 +179,7 @@ F src/test_config.c 4f85387a52f3c7966c3ffab913e988a3830fe1af F src/test_devsym.c 9f4bc2551e267ce7aeda195f3897d0f30c5228f4 F src/test_func.c a55c4d5479ff2eb5c0a22d4d88e9528ab59c953b F src/test_hexio.c 2f1122aa3f012fa0142ee3c36ce5c902a70cd12f -F src/test_journal.c ce3da048786536f0264ca5135c9639e34d1fbe3f +F src/test_journal.c 88a097a9123e52f9a6cc1ce66f53d43304582a03 F src/test_loadext.c 97dc8800e46a46ed002c2968572656f37e9c0dd9 F src/test_malloc.c cf348d78704340f72f8ab9f9327a6d4a0d71d351 F src/test_md5.c 28209a4e2068711b5443c33104fe41f21d160071 @@ -693,7 +693,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 1fe79ffd772900bdca85ec6cf072677be53cd5ff -R 87c27604ca2a8f994ba149dc1bd570fa +P 0f57011e3b21fa5f6a819ce5a7fd8d44ea70679f +R cebd5b9f713ddcff8e7a2c71139b4a4c U danielk1977 -Z d97d5e645b9d94f84adc7e2da92df732 +Z 62d24e33d87117ee5ab38c9511e98dd8 diff --git a/manifest.uuid b/manifest.uuid index e4a84c58c8..441b07d88b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0f57011e3b21fa5f6a819ce5a7fd8d44ea70679f \ No newline at end of file +ccc9c211a285fd4da68b69e15594f080371be522 \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 5a7be86a64..0ee2e18ca3 100644 --- a/src/pager.c +++ b/src/pager.c @@ -18,7 +18,7 @@ ** file simultaneously, or one process from reading the database while ** another is writing. ** -** @(#) $Id: pager.c,v 1.539 2009/01/07 15:33:46 drh Exp $ +** @(#) $Id: pager.c,v 1.540 2009/01/07 18:08:49 danielk1977 Exp $ */ #ifndef SQLITE_OMIT_DISKIO #include "sqliteInt.h" @@ -3926,7 +3926,7 @@ int sqlite3PagerCommitPhaseOne( Pgno iSkip = PAGER_MJ_PGNO(pPager); Pgno dbSize = pPager->dbSize; pPager->dbSize = pPager->dbOrigSize; - for( i=pPager->dbSize+1; i<=pPager->dbOrigSize; i++ ){ + for( i=dbSize+1; i<=pPager->dbOrigSize; i++ ){ if( !sqlite3BitvecTest(pPager->pInJournal, i) && i!=iSkip ){ rc = sqlite3PagerGet(pPager, i, &pPg); if( rc!=SQLITE_OK ) goto sync_exit; diff --git a/src/test_journal.c b/src/test_journal.c index 9171a4ca3d..7acfbd1ed9 100644 --- a/src/test_journal.c +++ b/src/test_journal.c @@ -19,7 +19,7 @@ ** b) the page was not a free-list leaf page when the transaction was ** first opened. ** -** $Id: test_journal.c,v 1.6 2009/01/06 17:52:44 danielk1977 Exp $ +** $Id: test_journal.c,v 1.7 2009/01/07 18:08:49 danielk1977 Exp $ */ #if SQLITE_TEST /* This file is used for testing only */ @@ -332,6 +332,13 @@ static int jtTruncate(sqlite3_file *pFile, sqlite_int64 size){ jt_file *pMain = locateDatabaseHandle(p->zName); closeTransaction(pMain); } + if( p->flags&SQLITE_OPEN_MAIN_DB && p->pWritable ){ + u32 pgno; + u32 locking_page = (u32)(PENDING_BYTE/p->nPagesize+1); + for(pgno=size/p->nPagesize+1; pgno<=p->nPage; pgno++){ + assert( pgno==locking_page || sqlite3BitvecTest(p->pWritable, pgno) ); + } + } return sqlite3OsTruncate(p->pReal, size); } @@ -372,6 +379,7 @@ static int readJournalFile(jt_file *p, jt_file *pMain){ if( iSize>=(iOff+nSector) ){ rc = sqlite3OsRead(pReal, zBuf, 28, iOff); if( rc!=SQLITE_OK || 0==decodeJournalHdr(zBuf, 0, 0, 0, 0) ){ +assert(rc!=SQLITE_OK); continue; } }