1
0
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:
dan
2020-05-05 20:30:07 +00:00
parent 8714de97c0
commit 58021b237a
9 changed files with 140 additions and 63 deletions

View File

@@ -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
/*