Add assert() statements to verify that the SQLITE_OPEN_EXCLUSIVE flag is always passed to the VFS when opening a temporary file.
FossilOrigin-Name: e123da49ccae61d591abded52f4721aa10f20d75935c9a3e3fe826a9b8df2317
This commit is contained in:
@@ -359,6 +359,8 @@ int sqlite3JournalOpen(
|
||||
){
|
||||
MemJournal *p = (MemJournal*)pJfd;
|
||||
|
||||
assert( zName || nSpill<0 || (flags & SQLITE_OPEN_EXCLUSIVE) );
|
||||
|
||||
/* Zero the file-handle object. If nSpill was passed zero, initialize
|
||||
** it using the sqlite3OsOpen() function of the underlying VFS. In this
|
||||
** case none of the code in this module is executed as a result of calls
|
||||
|
||||
@@ -223,6 +223,7 @@ int sqlite3OsOpen(
|
||||
** down into the VFS layer. Some SQLITE_OPEN_ flags (for example,
|
||||
** SQLITE_OPEN_FULLMUTEX or SQLITE_OPEN_SHAREDCACHE) are blocked before
|
||||
** reaching the VFS. */
|
||||
assert( zPath || (flags & SQLITE_OPEN_EXCLUSIVE) );
|
||||
rc = pVfs->xOpen(pVfs, zPath, pFile, flags & 0x1087f7f, pFlagsOut);
|
||||
assert( rc==SQLITE_OK || pFile->pMethods==0 );
|
||||
return rc;
|
||||
|
||||
@@ -5786,6 +5786,7 @@ static int pager_open_journal(Pager *pPager){
|
||||
|
||||
if( pPager->tempFile ){
|
||||
flags |= (SQLITE_OPEN_DELETEONCLOSE|SQLITE_OPEN_TEMP_JOURNAL);
|
||||
flags |= SQLITE_OPEN_EXCLUSIVE;
|
||||
nSpill = sqlite3Config.nStmtSpill;
|
||||
}else{
|
||||
flags |= SQLITE_OPEN_MAIN_JOURNAL;
|
||||
|
||||
Reference in New Issue
Block a user