From dc1106148aee75dc069e820fef0b4894d652582b Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 6 Aug 2010 09:43:03 +0000 Subject: [PATCH] Modify test_journal.c to work with pre-allocated databases. FossilOrigin-Name: 4894a5d21044b169f412fef095e689cb8a8575dc --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/test_journal.c | 10 +++++++++- test/fallocate.test | 6 ++++++ 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index d9b39071df..3770cf9225 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sbug\sto\sdo\swith\sdeleting\sthe\sjournal\sfile\swhen\sexiting\sexclusive-locking\smode. -D 2010-08-06T06:54:48 +C Modify\stest_journal.c\sto\swork\swith\spre-allocated\sdatabases. +D 2010-08-06T09:43:04 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -198,7 +198,7 @@ F src/test_hexio.c 1237f000ec7a491009b1233f5c626ea71bce1ea2 F src/test_init.c 5d624ffd0409d424cf9adbfe1f056b200270077c F src/test_intarray.c d879bbf8e4ce085ab966d1f3c896a7c8b4f5fc99 F src/test_intarray.h 489edb9068bb926583445cb02589344961054207 -F src/test_journal.c 424a334cdfdc8a6f975abe3641440147bded3185 +F src/test_journal.c 5ac89727cadbcc71954067b319eb40aff71dead2 F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e F src/test_malloc.c 058e41dc853b1fa8ccd1083e9571018a74aeb3a7 F src/test_mutex.c ce06b59aca168cd8c520b77159a24352a7469bd3 @@ -351,7 +351,7 @@ F test/exclusive.test b1f9012cabc124af947165d15ffa62ad20f63db8 F test/exclusive2.test fcbb1c9ca9739292a0a22a3763243ad6d868086b F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7 F test/expr.test 9f521ae22f00e074959f72ce2e55d46b9ed23f68 -F test/fallocate.test 0594314eb04268f7d0779d054fa850a36a5ae8bc +F test/fallocate.test 56242d30325fa451247d13e103cf1c357751a066 F test/filectrl.test 97003734290887566e01dded09dc9e99cb937e9e F test/filefmt.test f77c92141960b7933bc6691631d2ad62257ef40a F test/fkey1.test 01c7de578e11747e720c2d9aeef27f239853c4da @@ -843,7 +843,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 54eff6de9d8d87f33192c192ca91907c4c090988 -R d766f7dfb5a440ae684ea90a650f2fcb +P 6217b607f0cd60383c6cb4ab0fe9da008f611244 +R 14b2ef30676c4e420e673009cd2ed209 U dan -Z d043fca41f68ab4a258746c2916bd634 +Z f16fc7fc34cf746cc2538d8ca729728e diff --git a/manifest.uuid b/manifest.uuid index 6fc4825e63..41a2b36786 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6217b607f0cd60383c6cb4ab0fe9da008f611244 \ No newline at end of file +4894a5d21044b169f412fef095e689cb8a8575dc \ No newline at end of file diff --git a/src/test_journal.c b/src/test_journal.c index 97e0e1b70a..0300fb8716 100644 --- a/src/test_journal.c +++ b/src/test_journal.c @@ -379,6 +379,15 @@ static int openTransaction(jt_file *pMain, jt_file *pJournal){ ** leaf to the jt_file.pWritable bitvec. */ rc = sqlite3OsRead(p, aData, pMain->nPagesize, 0); + if( rc==SQLITE_OK ){ + u32 nDbsize = decodeUint32(&aData[28]); + if( nDbsize>0 && memcmp(&aData[24], &aData[92], 4)==0 ){ + u32 iPg; + for(iPg=nDbsize+1; iPg<=pMain->nPage; iPg++){ + sqlite3BitvecSet(pMain->pWritable, iPg); + } + } + } iTrunk = decodeUint32(&aData[32]); while( rc==SQLITE_OK && iTrunk>0 ){ u32 nLeaf; @@ -492,7 +501,6 @@ finish_rjf: return rc; } - /* ** Write data to an jt-file. */ diff --git a/test/fallocate.test b/test/fallocate.test index 82ceb1d8fa..ab41fe0a23 100644 --- a/test/fallocate.test +++ b/test/fallocate.test @@ -68,6 +68,10 @@ do_test fallocate-1.8 { execsql { COMMIT } } {} # The following tests - fallocate-2.* - test that things work in WAL # mode as well. # +set skipwaltests [expr {[permutation]=="journaltest"}] +ifcapable !wal { set skipwaltests 1 } + +if {!$skipwaltests} { db close file delete -force test.db sqlite3 db test.db @@ -130,6 +134,8 @@ do_test fallocate-2.8 { file size test.db } [expr 32*1024] +} + finish_test