From: mistachkin Date: Sat, 23 Mar 2013 12:15:27 +0000 (+0000) Subject: In the winMremap VFS function, unmap the region prior to attempting to truncate the... X-Git-Tag: version-3.7.17~114^2~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2753388e8ae49d71e7b3edc71793950aa002c07d;p=thirdparty%2Fsqlite.git In the winMremap VFS function, unmap the region prior to attempting to truncate the file. FossilOrigin-Name: 8870c4cc6cda07154936644f7df25bd81d6ba38a --- diff --git a/manifest b/manifest index a39a1c5070..ada3b7db89 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Do\snot\sunmap\sthe\smapped\sfile\sregion\sin\swinTruncate\sas\sthere\smay\sbe\soutstanding\spointers\sto\sit. -D 2013-03-23T10:09:46.701 +C In\sthe\swinMremap\sVFS\sfunction,\sunmap\sthe\sregion\sprior\sto\sattempting\sto\struncate\sthe\sfile. +D 2013-03-23T12:15:27.020 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 9a804abbd3cae82d196e4d33aba13239e32522a5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -161,7 +161,7 @@ F src/os.c 87ea1cd1259c5840848e34007d72e772a2ab7528 F src/os.h 8d92f87f5fe14b060a853ca704b8ef6d3daee79b F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_unix.c 55d110879332831b734fd510cfbc5700e96a83cf -F src/os_win.c 8f7de0046d5107be715aa91d7deebbf91d577644 +F src/os_win.c 386f8c034b177b672f7819ddc5d80be6c8d593ac F src/pager.c 12b8ff12519fe529a92884c4cdb99afecb1bea3c F src/pager.h bbc9170281c9d5d603b2175fdc8ea908e47269a7 F src/parse.y 5d5e12772845805fdfeb889163516b84fbb9ae95 @@ -1039,7 +1039,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P 75a85a1c6ac59f2d021c28fa2161afb1118deea4 -R 2ac6e41fa14b2fcb69f496caa13f7e10 +P f57a9c91e993f76ce8b923e06e721414980e8e61 +R a68c203c916fb468751938d0762a7812 U mistachkin -Z 3096704ce1da72ac81b0db8561977d4e +Z c2b92e0c0a8c400cb287f5f47ed82e78 diff --git a/manifest.uuid b/manifest.uuid index 18b01de7dd..0e0a52b9c3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f57a9c91e993f76ce8b923e06e721414980e8e61 \ No newline at end of file +8870c4cc6cda07154936644f7df25bd81d6ba38a \ No newline at end of file diff --git a/src/os_win.c b/src/os_win.c index 8d58ab0d44..8242a33849 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -3560,7 +3560,10 @@ static int winMremap( sqlite3_int64 oldSz; rc = winFileSize(id, &oldSz); if( rc==SQLITE_OK && nNewRnd>oldSz ){ - rc = winTruncate(id, nNewRnd); + rc = winUnmap(id); /* Cannot truncate the file with an open mapping. */ + if( rc==SQLITE_OK ){ + rc = winTruncate(id, nNewRnd); + } } if( rc!=SQLITE_OK ) return rc; }