mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Remove the undocumented PRAGMA omit_readlock hack.
FossilOrigin-Name: 96900c47e4fc6ed55cefc10d55d3d8d16bcb1d31
This commit is contained in:
24
src/pager.c
24
src/pager.c
@@ -612,7 +612,6 @@ struct Pager {
|
||||
u8 exclusiveMode; /* Boolean. True if locking_mode==EXCLUSIVE */
|
||||
u8 journalMode; /* One of the PAGER_JOURNALMODE_* values */
|
||||
u8 useJournal; /* Use a rollback journal on this file */
|
||||
u8 noReadlock; /* Do not bother to obtain readlocks */
|
||||
u8 noSync; /* Do not sync the journal if true */
|
||||
u8 fullSync; /* Do extra syncs of the journal for robustness */
|
||||
u8 ckptSyncFlags; /* SYNC_NORMAL or SYNC_FULL for checkpoint */
|
||||
@@ -860,7 +859,7 @@ static int assert_pager_state(Pager *p){
|
||||
case PAGER_READER:
|
||||
assert( pPager->errCode==SQLITE_OK );
|
||||
assert( p->eLock!=UNKNOWN_LOCK );
|
||||
assert( p->eLock>=SHARED_LOCK || p->noReadlock );
|
||||
assert( p->eLock>=SHARED_LOCK );
|
||||
break;
|
||||
|
||||
case PAGER_WRITER_LOCKED:
|
||||
@@ -3069,7 +3068,7 @@ static int pagerPagecount(Pager *pPager, Pgno *pnPage){
|
||||
** contains no valid committed transactions.
|
||||
*/
|
||||
assert( pPager->eState==PAGER_OPEN );
|
||||
assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock );
|
||||
assert( pPager->eLock>=SHARED_LOCK );
|
||||
nPage = sqlite3WalDbsize(pPager->pWal);
|
||||
|
||||
/* If the database size was not available from the WAL sub-system,
|
||||
@@ -3124,7 +3123,7 @@ static int pagerPagecount(Pager *pPager, Pgno *pnPage){
|
||||
static int pagerOpenWalIfPresent(Pager *pPager){
|
||||
int rc = SQLITE_OK;
|
||||
assert( pPager->eState==PAGER_OPEN );
|
||||
assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock );
|
||||
assert( pPager->eLock>=SHARED_LOCK );
|
||||
|
||||
if( !pPager->tempFile ){
|
||||
int isWal; /* True if WAL file exists */
|
||||
@@ -4287,7 +4286,7 @@ static int pagerStress(void *p, PgHdr *pPg){
|
||||
**
|
||||
** The flags argument is used to specify properties that affect the
|
||||
** operation of the pager. It should be passed some bitwise combination
|
||||
** of the PAGER_OMIT_JOURNAL and PAGER_NO_READLOCK flags.
|
||||
** of the PAGER_* flags.
|
||||
**
|
||||
** The vfsFlags parameter is a bitmask to pass to the flags parameter
|
||||
** of the xOpen() method of the supplied VFS when opening files.
|
||||
@@ -4318,7 +4317,6 @@ int sqlite3PagerOpen(
|
||||
char *zPathname = 0; /* Full path to database file */
|
||||
int nPathname = 0; /* Number of bytes in zPathname */
|
||||
int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */
|
||||
int noReadlock = (flags & PAGER_NO_READLOCK)!=0; /* True to omit read-lock */
|
||||
int pcacheSize = sqlite3PcacheSize(); /* Bytes to allocate for PCache */
|
||||
u32 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; /* Default page size */
|
||||
const char *zUri = 0; /* URI args to copy */
|
||||
@@ -4525,7 +4523,6 @@ int sqlite3PagerOpen(
|
||||
IOTRACE(("OPEN %p %s\n", pPager, pPager->zFilename))
|
||||
|
||||
pPager->useJournal = (u8)useJournal;
|
||||
pPager->noReadlock = (noReadlock && readOnly) ?1:0;
|
||||
/* pPager->stmtOpen = 0; */
|
||||
/* pPager->stmtInUse = 0; */
|
||||
/* pPager->nRef = 0; */
|
||||
@@ -4747,14 +4744,11 @@ int sqlite3PagerSharedLock(Pager *pPager){
|
||||
int bHotJournal = 1; /* True if there exists a hot journal-file */
|
||||
|
||||
assert( !MEMDB );
|
||||
assert( pPager->noReadlock==0 || pPager->readOnly );
|
||||
|
||||
if( pPager->noReadlock==0 ){
|
||||
rc = pager_wait_on_lock(pPager, SHARED_LOCK);
|
||||
if( rc!=SQLITE_OK ){
|
||||
assert( pPager->eLock==NO_LOCK || pPager->eLock==UNKNOWN_LOCK );
|
||||
goto failed;
|
||||
}
|
||||
rc = pager_wait_on_lock(pPager, SHARED_LOCK);
|
||||
if( rc!=SQLITE_OK ){
|
||||
assert( pPager->eLock==NO_LOCK || pPager->eLock==UNKNOWN_LOCK );
|
||||
goto failed;
|
||||
}
|
||||
|
||||
/* If a journal file exists, and there is no RESERVED lock on the
|
||||
@@ -6762,7 +6756,7 @@ static int pagerOpenWal(Pager *pPager){
|
||||
int rc = SQLITE_OK;
|
||||
|
||||
assert( pPager->pWal==0 && pPager->tempFile==0 );
|
||||
assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK || pPager->noReadlock);
|
||||
assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK );
|
||||
|
||||
/* If the pager is already in exclusive-mode, the WAL module will use
|
||||
** heap-memory for the wal-index instead of the VFS shared-memory
|
||||
|
Reference in New Issue
Block a user