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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user