mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Do not attempt to take any write lock on a read-only database on Windows.
FossilOrigin-Name: a47ff0cdab0f82398c68ea770053f193f4812a51
This commit is contained in:
@@ -3015,6 +3015,12 @@ static int winLock(sqlite3_file *id, int locktype){
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/* Do not allow any kind of write-lock on a read-only database
|
||||
*/
|
||||
if( (pFile->ctrlFlags & WINFILE_RDONLY)!=0 && locktype>=RESERVED_LOCK ){
|
||||
return SQLITE_IOERR_LOCK;
|
||||
}
|
||||
|
||||
/* Make sure the locking sequence is correct
|
||||
*/
|
||||
assert( pFile->locktype!=NO_LOCK || locktype==SHARED_LOCK );
|
||||
|
||||
Reference in New Issue
Block a user