mirror of
https://github.com/sqlite/sqlite.git
synced 2025-12-21 13:38:01 +03:00
Fix an assert() that could fail within calls to sqlite3_snapshot_open() in SQLITE_ENABLE_SETLK_TIMEOUT builds.
FossilOrigin-Name: 84634bc268e5c80146f3f3b2e13118f239c9a7e4e4e9dfcaccef2b17252ce53b
This commit is contained in:
@@ -4980,12 +4980,15 @@ static int unixShmLock(
|
||||
** It is not permitted to block on the RECOVER lock.
|
||||
*/
|
||||
#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
|
||||
assert( (flags & SQLITE_SHM_UNLOCK) || pDbFd->iBusyTimeout==0 || (
|
||||
(ofst!=2) /* not RECOVER */
|
||||
&& (ofst!=1 || (p->exclMask|p->sharedMask)==0)
|
||||
&& (ofst!=0 || (p->exclMask|p->sharedMask)<3)
|
||||
&& (ofst<3 || (p->exclMask|p->sharedMask)<(1<<ofst))
|
||||
));
|
||||
{
|
||||
u16 lockMask = (p->exclMask|p->sharedMask);
|
||||
assert( (flags & SQLITE_SHM_UNLOCK) || pDbFd->iBusyTimeout==0 || (
|
||||
(ofst!=2) /* not RECOVER */
|
||||
&& (ofst!=1 || lockMask==0 || lockMask==2)
|
||||
&& (ofst!=0 || lockMask<3)
|
||||
&& (ofst<3 || lockMask<(1<<ofst))
|
||||
));
|
||||
}
|
||||
#endif
|
||||
|
||||
mask = (1<<(ofst+n)) - (1<<ofst);
|
||||
|
||||
Reference in New Issue
Block a user