diff options
Diffstat (limited to 'src/os_win.c')
-rw-r--r-- | src/os_win.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/os_win.c b/src/os_win.c index 63afac81a..d84bda4ef 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -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 ); |