1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Handle the case in os_unix.c where SQLITE_FCNTL_MMAP_LIMIT requests that the mmap limit be set to a value smaller than the current mapping.

FossilOrigin-Name: 360473493ec1a7094a2b1c5436f3b70914a6dfdd
This commit is contained in:
dan
2013-04-08 15:30:41 +00:00
parent 554052c600
commit bcb8a868ce
3 changed files with 12 additions and 9 deletions

View File

@@ -3712,7 +3712,10 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){
case SQLITE_FCNTL_MMAP_LIMIT: {
i64 newLimit = *(i64*)pArg;
*(i64*)pArg = pFile->mmapLimit;
if( newLimit>=0 ) pFile->mmapLimit = newLimit;
if( newLimit>=0 ){
pFile->mmapLimit = newLimit;
if( newLimit<pFile->mmapSize ) pFile->mmapSize = newLimit;
}
return SQLITE_OK;
}
#ifdef SQLITE_DEBUG