Check in the instrumented code for the mptest test case that appears to show a spontaneously disappearing journal file.
FossilOrigin-Name: 96f04d99f3646189411cd6c6a3b5865f3e12d7d7
diff --git a/manifest b/manifest
index fdbb616..34eb1b4 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Disable\sthe\suse\sof\smemory-mapped\sI/O\sif\sthe\sSQLITE_DISABLE_MMAP\smacro\sis\ndefined.\s\sAutomatically\sdefine\sthis\smacro\sfor\sOpenBSD\sand\sQNX.\s\sOther\nsystems\sare\slikely\sto\sbe\sadded\sto\sthe\sdisabled\slist\sover\stime.
-D 2013-04-08T20:47:49.018
+C Check\sin\sthe\sinstrumented\scode\sfor\sthe\smptest\stest\scase\sthat\sappears\sto\sshow\sa\sspontaneously\sdisappearing\sjournal\sfile.
+D 2013-04-09T19:19:01.777
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 6a6a8c548822302d3a9a651f0296bbc3dad55e83
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -111,7 +111,7 @@
F mkopcodeh.awk 29b84656502eee5f444c3147f331ee686956ab0e
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
F mptest/config01.test 3f4ddeb152a4f83872f0fa7fcb48d9fd609893da
-F mptest/config02.test 962913ed2b537d60de4126db7fe54716865cdd22
+F mptest/config02.test ea934966341e3827b5563279af576b361e4dda11
F mptest/crash01.test a5f31998ed48de8267d6620e8af107ec148e5f12
F mptest/crash02.subtest c4647feafa04109e1dc60121a895b6cba8d63ceb
F mptest/mptest.c e31bb60d3de960aa0f7d08af7ae59c6dfecc552b
@@ -166,9 +166,9 @@
F src/os.c ca679b293a6233327e418fd1dde2cd5db3e90932
F src/os.h ae08bcc5f6ec6b339f4a2adf3931bb88cc14c3e4
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
-F src/os_unix.c 6d584190db2ed442e5c849b7f73dcfbbac7c032e
+F src/os_unix.c d732dca04fc27bf2d92a4de6f78b91cedd36b270
F src/os_win.c 3265df8c762e0b8caf8d02b3352fa8c22e91ae6b
-F src/pager.c eb6d272f4dc1ade4b8f664599cd54a9c95cb2729
+F src/pager.c fc108b8da737a5e429244a59a6c97045e30f3337
F src/pager.h 5cb78b8e1adfd5451e600be7719f5a99d87ac3b1
F src/parse.y 5d5e12772845805fdfeb889163516b84fbb9ae95
F src/pcache.c f8043b433a57aba85384a531e3937a804432a346
@@ -249,7 +249,7 @@
F src/vdbe.h b52887278cb173e66188da84dfab216bea61119d
F src/vdbeInt.h c1e830268b75f04a2901dd895b51a637a26c7045
F src/vdbeapi.c 085cf9bf169b859a6c8fa43791702bac805cb7aa
-F src/vdbeaux.c ecb43014bcd3019e5aa2b5561e5c3a447f007a08
+F src/vdbeaux.c 1521655b876c035963baa0fe124699563495e4f4
F src/vdbeblob.c 5dc79627775bd9a9b494dd956e26297946417d69
F src/vdbemem.c 833005f1cbbf447289f1973dba2a0c2228c7b8ab
F src/vdbesort.c 4fad64071ae120c25f39dcac572d716b9cadeb7f
@@ -1050,7 +1050,10 @@
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P ae8bb24bfb014bdcb8aaa8159ddae0cd376afe99
-R 7e782b1e3841573f5a2d86903a4acfcf
-U drh
-Z a7d6d975495e51a139482ed48c14db14
+P 8a4314a398c6c6efb25e6993c826b7e60d9bb1f9
+R 96c196a2830d15077528814491807a44
+T *branch * missing-journal-file
+T *sym-missing-journal-file *
+T -sym-trunk *
+U dan
+Z 991b3a64656b6e80801efa47bfbb23d0
diff --git a/manifest.uuid b/manifest.uuid
index 387ecfb..aa81432 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-8a4314a398c6c6efb25e6993c826b7e60d9bb1f9
\ No newline at end of file
+96f04d99f3646189411cd6c6a3b5865f3e12d7d7
\ No newline at end of file
diff --git a/mptest/config02.test b/mptest/config02.test
index e25d940..39c27bb 100644
--- a/mptest/config02.test
+++ b/mptest/config02.test
@@ -6,13 +6,13 @@
PRAGMA mmap_limit=0;
--end
--task 2
- PRAGMA mmap_limit=28672;
+ PRAGMA mmap_limit=0;
--end
--task 3
- PRAGMA mmap_limit=8192;
+ PRAGMA mmap_limit=0;
--end
--task 4
- PRAGMA mmap_limit=65536;
+ PRAGMA mmap_limit=0;
--end
--source multiwrite01.test
--source crash02.subtest
diff --git a/src/os_unix.c b/src/os_unix.c
index 1d4c8ad..4aeef7e 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1879,6 +1879,8 @@
unixUnlock(id, NO_LOCK);
unixEnterMutex();
+access(pFile->zPath, F_OK);
+
/* unixFile.pInode is always valid here. Otherwise, a different close
** routine (e.g. nolockClose()) would be called instead.
*/
@@ -3214,6 +3216,8 @@
);
#endif
+access(pFile->zPath, F_OK);
+
#ifdef SQLITE_DEBUG
/* If we are doing a normal write to a database file (as opposed to
** doing a hot-journal rollback or a write to some file other than a
@@ -5574,6 +5578,7 @@
return rc;
}
fd = robust_open(zName, openFlags, openMode);
+ access(zName, F_OK);
OSTRACE(("OPENX %-3d %s 0%o\n", fd, zName, openFlags));
if( fd<0 && errno!=EISDIR && isReadWrite && !isExclusive ){
/* Failed to open the file for read/write access. Try read-only. */
@@ -5709,6 +5714,7 @@
int rc = SQLITE_OK;
UNUSED_PARAMETER(NotUsed);
SimulateIOError(return SQLITE_IOERR_DELETE);
+ access(zPath, F_OK);
if( osUnlink(zPath)==(-1) ){
if( errno==ENOENT ){
rc = SQLITE_IOERR_DELETE_NOENT;
diff --git a/src/pager.c b/src/pager.c
index e3ac49c..dce1bf5 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -1966,6 +1966,7 @@
sqlite3OsClose(pPager->jfd);
if( bDelete ){
rc = sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0);
+assert( rc!=SQLITE_IOERR_DELETE_NOENT );
}
}
}
@@ -2473,6 +2474,7 @@
sqlite3OsClose(pMaster);
rc = sqlite3OsDelete(pVfs, zMaster, 0);
+assert( rc!=SQLITE_IOERR_DELETE_NOENT );
delmaster_out:
sqlite3_free(zMasterJournal);
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index 2c4269a..0e7d5ab 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -1931,6 +1931,7 @@
** transaction files are deleted.
*/
rc = sqlite3OsDelete(pVfs, zMaster, 1);
+assert( rc!=SQLITE_IOERR_DELETE_NOENT );
sqlite3DbFree(db, zMaster);
zMaster = 0;
if( rc ){