mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Unless upgrading an existing read transaction, have ENABLE_SETLK_TIMEOUT builds attempt to use a blocking lock when opening a write transaction on a wal mode database.
FossilOrigin-Name: d6f819a9e6b35f3fd558bd93255a6a24ad690a0fa15a82b009ca9c641db983c6
This commit is contained in:
16
src/pager.c
16
src/pager.c
@@ -7574,7 +7574,21 @@ int sqlite3PagerCloseWal(Pager *pPager, sqlite3 *db){
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
|
||||
/*
|
||||
** If pager pPager is a wal-mode database not in exclusive locking mode,
|
||||
** invoke the sqlite3WalWriteLock() function on the associated Wal object
|
||||
** with the same db and bLock parameters as were passed to this function.
|
||||
** Return an SQLite error code if an error occurs, or SQLITE_OK otherwise.
|
||||
*/
|
||||
int sqlite3PagerWalWriteLock(sqlite3 *db, Pager *pPager, int bLock){
|
||||
int rc = SQLITE_OK;
|
||||
if( pagerUseWal(pPager) && pPager->exclusiveMode==0 ){
|
||||
rc = sqlite3WalWriteLock(db, pPager->pWal, bLock);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_ENABLE_SNAPSHOT
|
||||
/*
|
||||
|
Reference in New Issue
Block a user