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

Add a fix for the assert() statements added by the previous commit.

FossilOrigin-Name: 19345416ed5e1ab5b0b35993b0b9069c2fb1683b
This commit is contained in:
dan
2013-03-22 17:46:11 +00:00
parent 6101d50471
commit c00033125d
3 changed files with 16 additions and 8 deletions

View File

@@ -3470,6 +3470,14 @@ static int unixTruncate(sqlite3_file *id, i64 nByte){
if( pFile->inNormalWrite && nByte==0 ){
pFile->transCntrChng = 1;
}
/* If the file was just truncated to a size smaller than the currently
** mapped region, reduce the effective mapping size as well. SQLite will
** use read() and write() to access data beyond this point from now on.
*/
if( nByte<pFile->mmapSize ){
pFile->mmapSize = nByte;
}
#endif
return SQLITE_OK;
@@ -4461,7 +4469,7 @@ static int unixMremap(
i64 nOldRnd; /* nOld rounded up */
assert( iOff==0 );
assert( p->mmapSize==nOld );
/* assert( p->mmapSize==nOld ); */
assert( p->pMapRegion==0 || p->pMapRegion==(*ppMap) );
/* If the SQLITE_MREMAP_EXTEND flag is set, then the size of the requested