diff --git a/manifest b/manifest index 0b41ca5008..108aca806a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sxDelete\simplementation\sof\sthe\smultiplexor\sVFS\sso\sthat\sit\scorrectly\ndeletes\soverflow\sWAL\sfiles. -D 2012-02-27T14:28:50.338 +C Fix\sa\scase\swhere\san\serror\scode\swas\sbeing\soverwritten\sin\smultiplexDelete(). +D 2012-02-28T11:52:12.825 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 3f79a373e57c3b92dabf76f40b065e719d31ac34 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -214,7 +214,7 @@ F src/test_intarray.h 489edb9068bb926583445cb02589344961054207 F src/test_journal.c a6a6baf343f79b942331f13378d045e7e270ae64 F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e F src/test_malloc.c cfe25d74333892ababde61196821a889b4756dee -F src/test_multiplex.c 0b3111a8c1b11963b2ca17a4b47219a5942bc9c0 +F src/test_multiplex.c 0404a61d7795438be5ee5fd3711eed80724df34d F src/test_multiplex.h e99c571bc4968b7a9363b661481f3934bfead61d F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec @@ -613,7 +613,7 @@ F test/misc7.test 6743b810884ef64ae14c07ad1f9f858c40c06100 F test/misuse.test ba4fb5d1a6101d1c171ea38b3c613d0661c83054 F test/multiplex.test e08cc7177bd6d85990ee1d71100bb6c684c02256 F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a -F test/multiplex3.test 15903c343f1eaa4b00998b7ceacfc4987e4ccfe9 +F test/multiplex3.test d228f59eac91839a977eac19f21d053f03e4d101 F test/mutex1.test 78b2b9bb320e51d156c4efdb71b99b051e7a4b41 F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660 F test/nan.test e9648b9d007c7045242af35e11a984d4b169443a @@ -990,7 +990,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 -P d6850667ea61172ea0ebea4a22b6b306f74775fa -R ea71d798aaf411fbd421b77e33a3053e -U drh -Z 3207ff66d565aff181a5c8c10cee009f +P e44e26771e5aa48f3bfa14d6db3e669b5b2a1e73 +R a83bd20b956aa8e93cec00d5fc1e4306 +U dan +Z a4ff6a0dae74370332c0513312e14191 diff --git a/manifest.uuid b/manifest.uuid index e813cbd424..8a835053fa 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e44e26771e5aa48f3bfa14d6db3e669b5b2a1e73 \ No newline at end of file +c267893a0813beb1764071409025e178318e1ca3 \ No newline at end of file diff --git a/src/test_multiplex.c b/src/test_multiplex.c index 0bdbb0e75b..e2b6720652 100644 --- a/src/test_multiplex.c +++ b/src/test_multiplex.c @@ -657,14 +657,16 @@ static int multiplexDelete( multiplexFilename(zName, nName, SQLITE_OPEN_MAIN_JOURNAL, --iChunk, z); rc = pOrigVfs->xDelete(pOrigVfs, z, syncDir); } - iChunk = 0; - do{ - multiplexFilename(zName, nName, SQLITE_OPEN_WAL, ++iChunk, z); - rc = pOrigVfs->xAccess(pOrigVfs, z, SQLITE_ACCESS_EXISTS, &bExists); - }while( rc==SQLITE_OK && bExists ); - while( rc==SQLITE_OK && iChunk>1 ){ - multiplexFilename(zName, nName, SQLITE_OPEN_WAL, --iChunk, z); - rc = pOrigVfs->xDelete(pOrigVfs, z, syncDir); + if( rc==SQLITE_OK ){ + iChunk = 0; + do{ + multiplexFilename(zName, nName, SQLITE_OPEN_WAL, ++iChunk, z); + rc = pOrigVfs->xAccess(pOrigVfs, z, SQLITE_ACCESS_EXISTS, &bExists); + }while( rc==SQLITE_OK && bExists ); + while( rc==SQLITE_OK && iChunk>1 ){ + multiplexFilename(zName, nName, SQLITE_OPEN_WAL, --iChunk, z); + rc = pOrigVfs->xDelete(pOrigVfs, z, syncDir); + } } } sqlite3_free(z); diff --git a/test/multiplex3.test b/test/multiplex3.test index 0f52d763be..c1e741acdb 100644 --- a/test/multiplex3.test +++ b/test/multiplex3.test @@ -127,6 +127,39 @@ for {set iTest 1} {$iTest<=100} {incr iTest} { db2 close } +catch { db close } + + +do_test 3.0 { setup_and_save_db } {} +do_faultsim_test 3 -faults ioerr-trans* -prep { + + forcedelete test2.db + set fd [open test2.wal w] + seek $fd 4095 + puts -nonewline $fd x + close $fd + + multiplex_restore_db + sqlite3 db file:test.db?8_3_names=1 + sqlite3 db2 file:test2.db?8_3_names=1 + sqlite3_multiplex_control db main chunk_size [expr 256*1024] + sqlite3_multiplex_control db2 main chunk_size [expr 256*1024] +} -body { + sqlite3_backup B db2 main db main + B step 100000 + set rc [B finish] + if { [string match SQLITE_IOERR_* $rc] } {error "disk I/O error"} + set rc +} -test { + faultsim_test_result {0 SQLITE_OK} + if {$testrc==0} { + set cksum2 [execsql {SELECT md5sum(a, b) FROM t1 ORDER BY a} db2] + if {$cksum2 != $::cksum1} { error "data mismatch" } + } + catch { B finish } + catch { db close } + catch { db2 close } +} catch { db close } sqlite3_multiplex_shutdown