From: drh Date: Wed, 9 Mar 2016 03:44:32 +0000 (+0000) Subject: Move the write failure test in memjrnlCreateFile() to just after the X-Git-Tag: version-3.12.0~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=769b4c95ca98318bf5ff2152f09148a9694e9ed7;p=thirdparty%2Fsqlite.git Move the write failure test in memjrnlCreateFile() to just after the actual write, thus reducing the number of instances of the test by one. FossilOrigin-Name: 7f00d80c63b15376391f661d872f2b29a970702d --- diff --git a/manifest b/manifest index 0c5b9408ab..cc0b431865 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sa\scomment\sin\sbtree.c\sto\saccount\sfor\sWITHOUT\sROWID\stables.\s\sNo\scode\nchanges. -D 2016-03-09T03:29:27.407 +C Move\sthe\swrite\sfailure\stest\sin\smemjrnlCreateFile()\sto\sjust\safter\sthe\nactual\swrite,\sthus\sreducing\sthe\snumber\sof\sinstances\sof\sthe\stest\sby\sone. +D 2016-03-09T03:44:32.424 F Makefile.in f53429fb2f313c099283659d0df6f20f932c861f F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc df0bf9ff7f8b3f4dd9fb4cc43f92fe58f6ec5c66 @@ -321,7 +321,7 @@ F src/mem1.c 6919bcf12f221868ea066eec27e579fed95ce98b F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3 F src/mem3.c 8768ac94694f31ffaf8b4d0ea5dc08af7010a35a F src/mem5.c 9bf955937b07f8c32541c8a9991f33ce3173d944 -F src/memjournal.c 9704b40cd63d53f584ac06c0cd1b52d399bb63ec +F src/memjournal.c 13ae08696117438e7fa2518af71e52ee00c02395 F src/msvc.h d9ba56c6851227ab44b3f228a35f3f5772296495 F src/mutex.c 8e45800ee78e0cd1f1f3fe8e398853307f4a085c F src/mutex.h 779d588e3b7756ec3ecf7d78cde1d84aba414f85 @@ -1455,7 +1455,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P ee486ef742557244f532e8d3b3604ff04e024b8a -R 58c822ca96b5496f25a8c479ed6f41b8 +P fa20dcb03b92be3bb32f8e3d6f88681ace3f6c84 +R ddfc9f5547c4cd989efbf516628daef2 U drh -Z 14a12081690d2b5a8e4723ef05aa614c +Z f80415911853dbc4f72e4c714eb20705 diff --git a/manifest.uuid b/manifest.uuid index 758bea7f1a..ad041f10c3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fa20dcb03b92be3bb32f8e3d6f88681ace3f6c84 \ No newline at end of file +7f00d80c63b15376391f661d872f2b29a970702d \ No newline at end of file diff --git a/src/memjournal.c b/src/memjournal.c index 706703ed80..ed1d6bba8c 100644 --- a/src/memjournal.c +++ b/src/memjournal.c @@ -145,13 +145,14 @@ static int memjrnlCreateFile(MemJournal *p){ int nChunk = copy.nChunkSize; i64 iOff = 0; FileChunk *pIter; - for(pIter=copy.pFirst; pIter && rc==SQLITE_OK; pIter=pIter->pNext){ + for(pIter=copy.pFirst; pIter; pIter=pIter->pNext){ int nWrite = nChunk; if( pIter==copy.endpoint.pChunk ){ nWrite = copy.endpoint.iOffset % copy.nChunkSize; if( nWrite==0 ) nWrite = copy.nChunkSize; } rc = sqlite3OsWrite(pReal, (u8*)pIter->zChunk, nWrite, iOff); + if( rc ) break; iOff += nWrite; } if( rc==SQLITE_OK ){