]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
In the winMremap VFS function, unmap the region prior to attempting to truncate the...
authormistachkin <mistachkin@noemail.net>
Sat, 23 Mar 2013 12:15:27 +0000 (12:15 +0000)
committermistachkin <mistachkin@noemail.net>
Sat, 23 Mar 2013 12:15:27 +0000 (12:15 +0000)
FossilOrigin-Name: 8870c4cc6cda07154936644f7df25bd81d6ba38a

manifest
manifest.uuid
src/os_win.c

index a39a1c5070e08d99c3740beb796440c6ff5a22cf..ada3b7db8947dfe1f3c70ec35b60dcfa2ba2832d 100644 (file)
--- 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
index 18b01de7ddc54d9e55957704566d4aa4674e0862..0e0a52b9c376b56b570c71a8776ef769eb4cf3c9 100644 (file)
@@ -1 +1 @@
-f57a9c91e993f76ce8b923e06e721414980e8e61
\ No newline at end of file
+8870c4cc6cda07154936644f7df25bd81d6ba38a
\ No newline at end of file
index 8d58ab0d44269834b440e2749438ae573b62189f..8242a33849f05c15d4a3573b21c7dd5205e84450 100644 (file)
@@ -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;
   }