From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Victor Costan Date: Fri, 23 Nov 2018 10:51:10 -0800 Subject: [PATCH 10/10] Backport Windows VFS mmap fix Original change: https://www.sqlite.org/src/info/8576ccb479fc4b76 Original change description: Make the winTruncate() method of the windows VFS be a no-op if there are outstanding references to the memory-mapped pages. Otherwise, memory might be deleted out from under those references when the file is remapped during the truncate operation. Bug: 897576 --- third_party/sqlite/src/src/os_win.c | 1 + 1 file changed, 1 insertion(+) diff --git a/third_party/sqlite/src/src/os_win.c b/third_party/sqlite/src/src/os_win.c index dfefc4452f02..5cd28a20e427 100644 --- a/third_party/sqlite/src/src/os_win.c +++ b/third_party/sqlite/src/src/os_win.c @@ -2906,6 +2906,7 @@ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){ DWORD lastErrno; #if SQLITE_MAX_MMAP_SIZE>0 sqlite3_int64 oldMmapSize; + if( pFile->nFetchOut>0 ) return SQLITE_OK; #endif assert( pFile ); -- 2.18.0