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

When an attempt to change journal_mode fails due to locks, be sure to

leave internal structures in a consistent state.

FossilOrigin-Name: cf3d1e0b8a739302cf2848ac3e6eaaae04e6a44c
This commit is contained in:
drh
2010-05-11 14:00:39 +00:00
parent 5543759b1b
commit be5481578a
4 changed files with 24 additions and 9 deletions

View File

@@ -5959,6 +5959,10 @@ int sqlite3PagerCloseWal(Pager *pPager){
pPager->pageSize, (u8*)pPager->pTmpSpace
);
pPager->pWal = 0;
}else{
/* If we cannot get an EXCLUSIVE lock, downgrade the PENDING lock
** that we did get back to SHARED. */
sqlite3OsUnlock(pPager->fd, SQLITE_LOCK_SHARED);
}
}
return rc;