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

Remove a condition that must always be true. Replace it with an assert().

FossilOrigin-Name: 7abcd54ec09e8025193d1e0ea57775051d823801
This commit is contained in:
drh
2010-06-10 01:07:42 +00:00
parent 3ccd20a7a9
commit 0350c7fa26
3 changed files with 20 additions and 12 deletions

View File

@@ -1438,15 +1438,13 @@ static int pager_end_transaction(Pager *pPager, int hasMaster){
if( pagerUseWal(pPager) ){
rc2 = sqlite3WalEndWriteTransaction(pPager->pWal);
assert( rc2==SQLITE_OK );
pPager->state = PAGER_SHARED;
/* If the connection was in locking_mode=exclusive mode but is no longer,
** drop the EXCLUSIVE lock held on the database file.
*/
if( rc2==SQLITE_OK
&& !pPager->exclusiveMode
&& sqlite3WalExclusiveMode(pPager->pWal, 0)
){
if( !pPager->exclusiveMode && sqlite3WalExclusiveMode(pPager->pWal, 0) ){
rc2 = osUnlock(pPager->fd, SHARED_LOCK);
}
}else if( !pPager->exclusiveMode ){