1
0
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:
dan
2013-05-23 10:13:18 +00:00
parent 34e258c942
commit 3719f5f600
4 changed files with 17 additions and 12 deletions

View File

@@ -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