mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Avoid unnecessary calls to FCNTL_SIZE_HINT. Return an error to the user if the file-control invoked by "PRAGMA mmap_size" returns a value other than SQLITE_OK or SQLITE_NOTFOUND.
FossilOrigin-Name: 40cfde8b4a59a09e52e62f9f029f8d3b32eb15fa
This commit is contained in:
@@ -774,11 +774,15 @@ void sqlite3Pragma(
|
||||
}
|
||||
}
|
||||
sz = -1;
|
||||
if( sqlite3_file_control(db,zDb,SQLITE_FCNTL_MMAP_SIZE,&sz)==SQLITE_OK ){
|
||||
rc = sqlite3_file_control(db, zDb, SQLITE_FCNTL_MMAP_SIZE, &sz);
|
||||
#if SQLITE_MAX_MMAP_SIZE==0
|
||||
sz = 0;
|
||||
sz = 0;
|
||||
#endif
|
||||
if( rc==SQLITE_OK ){
|
||||
returnSingleInt(pParse, "mmap_size", sz);
|
||||
}else if( rc!=SQLITE_NOTFOUND ){
|
||||
pParse->nErr++;
|
||||
pParse->rc = rc;
|
||||
}
|
||||
}else
|
||||
|
||||
|
||||
Reference in New Issue
Block a user