1
0
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:
dan
2017-07-11 20:36:35 +00:00
parent 416b8694fa
commit 1cd523cf0f
5 changed files with 24 additions and 9 deletions

View File

@ -1150,6 +1150,17 @@ static void fsGrowMapping(
}
}
/*
** If it is mapped, unmap the database file.
*/
int lsmFsUnmap(FileSystem *pFS){
int rc = LSM_OK;
if( pFS ){
rc = lsmEnvRemap(pFS->pEnv, pFS->fdDb, -1, &pFS->pMap, &pFS->nMap);
}
return rc;
}
/*
** fsync() the database file.
*/