Index: mptest/config02.test ================================================================== --- mptest/config02.test +++ mptest/config02.test @@ -4,17 +4,17 @@ PRAGMA page_size=512; --task 1 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 PRAGMA page_size=1024; VACUUM; Index: src/os_unix.c ================================================================== --- src/os_unix.c +++ src/os_unix.c @@ -1876,10 +1876,12 @@ static int unixClose(sqlite3_file *id){ int rc = SQLITE_OK; unixFile *pFile = (unixFile *)id; 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. */ assert( pFile->pInode->nLock>0 || pFile->pInode->bProcessLock==0 ); @@ -3211,10 +3213,12 @@ assert( pFile->pUnused==0 || offset>=PENDING_BYTE+512 || offset+amt<=PENDING_BYTE ); #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 ** normal database file) then record the fact that the database @@ -5572,10 +5576,11 @@ assert( !p->pUnused ); assert( eType==SQLITE_OPEN_WAL || eType==SQLITE_OPEN_MAIN_JOURNAL ); 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. */ flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE); openFlags &= ~(O_RDWR|O_CREAT); @@ -5707,10 +5712,11 @@ int dirSync /* If true, fsync() directory after deleting file */ ){ 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; }else{ rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath); Index: src/pager.c ================================================================== --- src/pager.c +++ src/pager.c @@ -1964,10 +1964,11 @@ || pPager->journalMode==PAGER_JOURNALMODE_WAL ); sqlite3OsClose(pPager->jfd); if( bDelete ){ rc = sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0); +assert( rc!=SQLITE_IOERR_DELETE_NOENT ); } } } #ifdef SQLITE_CHECK_PAGES @@ -2471,10 +2472,11 @@ zJournal += (sqlite3Strlen30(zJournal)+1); } sqlite3OsClose(pMaster); rc = sqlite3OsDelete(pVfs, zMaster, 0); +assert( rc!=SQLITE_IOERR_DELETE_NOENT ); delmaster_out: sqlite3_free(zMasterJournal); if( pMaster ){ sqlite3OsClose(pMaster); Index: src/vdbeaux.c ================================================================== --- src/vdbeaux.c +++ src/vdbeaux.c @@ -1929,10 +1929,11 @@ /* Delete the master journal file. This commits the transaction. After ** doing this the directory is synced again before any individual ** transaction files are deleted. */ rc = sqlite3OsDelete(pVfs, zMaster, 1); +assert( rc!=SQLITE_IOERR_DELETE_NOENT ); sqlite3DbFree(db, zMaster); zMaster = 0; if( rc ){ return rc; }