mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
In lsm, attempt to unmap the database file before truncating it when
disconnecting. A mapped file may not be truncated on win32. FossilOrigin-Name: 39069941e98605bc8c7c736819781761760ee2b83363471ceb6f19e5eb06b13a
This commit is contained in:
@ -312,6 +312,7 @@ static void doDbDisconnect(lsm_db *pDb){
|
||||
/* The database may only be truncated if there exist no read-only
|
||||
** clients - either connected or running rotrans transactions. */
|
||||
if( bReadonly==0 && bRotrans==0 ){
|
||||
lsmFsUnmap(pDb->pFS);
|
||||
dbTruncateFile(pDb);
|
||||
if( p->pFile && p->bMultiProc ){
|
||||
lsmEnvShmUnmap(pDb->pEnv, p->pFile, 1);
|
||||
@ -568,6 +569,7 @@ void lsmDbDatabaseRelease(lsm_db *pDb){
|
||||
doDbDisconnect(pDb);
|
||||
}
|
||||
|
||||
lsmFsUnmap(pDb->pFS);
|
||||
lsmMutexEnter(pDb->pEnv, p->pClientMutex);
|
||||
for(ppDb=&p->pConn; *ppDb!=pDb; ppDb=&((*ppDb)->pNext));
|
||||
*ppDb = pDb->pNext;
|
||||
|
Reference in New Issue
Block a user