diff options
Diffstat (limited to 'src/pragma.c')
-rw-r--r-- | src/pragma.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/pragma.c b/src/pragma.c index 9b31797d3..cd1cfbe21 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -745,26 +745,23 @@ void sqlite3Pragma( }else /* - ** PRAGMA [database.]mmap_size - ** PRAGMA [database.]mmap_size=N + ** PRAGMA [database.]mmap_limit(N) ** - ** Used to set or query the mapping size limit. The mapping size limit is + ** Used to set mapping size limit. The mapping size limit is ** used to limit the aggregate size of all memory mapped regions of the ** database file. If this parameter is set to zero, then memory mapping - ** is not used at all. If it is set to a positive value, then it is - ** interpreted as a maximum size in pages. If set to less than zero, then - ** the absolute value is interpreted as a size limit in KB. + ** is not used at all. The parameter N is measured in bytes. ** - ** The default value is zero (do not use memory mapped IO). + ** This value is advisory. The underlying VFS is free to memory map + ** as little or as much as it wants. Except, if N is set to 0 then the + ** upper layers will never invoke the xFetch interfaces to the VFS. */ - if( sqlite3StrICmp(zLeft,"mmap_size")==0 ){ + if( sqlite3StrICmp(zLeft,"mmap_limit")==0 ){ assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); - if( !zRight ){ - returnSingleInt(pParse, "mmap_size", pDb->pSchema->mmap_size); - }else{ - int size = sqlite3Atoi(zRight); - pDb->pSchema->mmap_size = size; - sqlite3BtreeSetMmapSize(pDb->pBt, pDb->pSchema->mmap_size); + if( zRight ){ + sqlite3_int64 size; + sqlite3Atoi64(zRight, &size, 1000, SQLITE_UTF8); + sqlite3BtreeSetMmapLimit(pDb->pBt, size); } }else |