1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Fix nolock and immutable so that they work even if READONLY is requested.

FossilOrigin-Name: e193aced2942e7405d0f45f90d4954b5663b4ba5
This commit is contained in:
drh
2014-05-07 15:32:03 +00:00
parent 62e603a904
commit 6451c2b04e
4 changed files with 57 additions and 15 deletions

View File

@@ -4676,8 +4676,8 @@ int sqlite3PagerOpen(
** + The largest page size that can be written atomically.
*/
if( rc==SQLITE_OK ){
int iDc = sqlite3OsDeviceCharacteristics(pPager->fd);
if( !readOnly ){
int iDc = sqlite3OsDeviceCharacteristics(pPager->fd);
setSectorSize(pPager);
assert(SQLITE_DEFAULT_PAGE_SIZE<=SQLITE_MAX_DEFAULT_PAGE_SIZE);
if( szPageDflt<pPager->sectorSize ){
@@ -4700,12 +4700,12 @@ int sqlite3PagerOpen(
}
}
#endif
pPager->noLock = sqlite3_uri_boolean(zFilename, "nolock", 0);
if( (iDc & SQLITE_IOCAP_IMMUTABLE)!=0
|| sqlite3_uri_boolean(zFilename, "immutable", 0) ){
vfsFlags |= SQLITE_OPEN_READONLY;
goto act_like_temp_file;
}
}
pPager->noLock = sqlite3_uri_boolean(zFilename, "nolock", 0);
if( (iDc & SQLITE_IOCAP_IMMUTABLE)!=0
|| sqlite3_uri_boolean(zFilename, "immutable", 0) ){
vfsFlags |= SQLITE_OPEN_READONLY;
goto act_like_temp_file;
}
}
}else{