]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Avoid attempting to rename the *-oal file while it is still open.
authordan <dan@noemail.net>
Thu, 16 Apr 2015 10:55:58 +0000 (10:55 +0000)
committerdan <dan@noemail.net>
Thu, 16 Apr 2015 10:55:58 +0000 (10:55 +0000)
FossilOrigin-Name: 658c3b0c80b9fe7eaac5982573651dc649a4c53f

ext/ota/sqlite3ota.c
manifest
manifest.uuid

index 6d0e899117083ab7816fb0dfc74cc2a23d4f7cf7..86eca8cff3f38484bbe4e8c7fded1f9670ee5642 100644 (file)
@@ -2047,16 +2047,18 @@ static void otaMoveOalFile(sqlite3ota *p){
     if( p->rc==SQLITE_OK ){
       otaFileSuffix3(zBase, zWal);
       otaFileSuffix3(zBase, zOal);
-      rename(zOal, zWal);
 
       /* Re-open the databases. */
       otaObjIterFinalize(&p->objiter);
       sqlite3_close(p->dbMain);
       sqlite3_close(p->dbOta);
-      p->dbMain = 0;
-      p->dbOta = 0;
-      otaOpenDatabase(p);
-      otaSetupCheckpoint(p, 0);
+      p->rc = rename(zOal, zWal) ? SQLITE_IOERR : SQLITE_OK;
+      if( p->rc==SQLITE_OK ){
+        p->dbMain = 0;
+        p->dbOta = 0;
+        otaOpenDatabase(p);
+        otaSetupCheckpoint(p, 0);
+      }
     }
   }
 
index fdc31f4e444e8e88b3bdc6f86e7ea126e00b099d..b3e8e485d07b52f4ec400727178c470814174b39 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Merge\sall\srecent\strunk\senhancements\sand\sfixes\sinto\sthe\sota-update\sbranch.
-D 2015-04-15T14:26:04.771
+C Avoid\sattempting\sto\srename\sthe\s*-oal\sfile\swhile\sit\sis\sstill\sopen.
+D 2015-04-16T10:55:58.879
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5f78b1ab81b64e7c57a75d170832443e66c0880a
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -138,7 +138,7 @@ F ext/ota/otaA.test ef4bfa8cfd4ed814ae86f7457b64aa2f18c90171
 F ext/ota/otacrash.test a078d34e2edbcedac5f894e3e7d08d452a327007
 F ext/ota/otafault.test 8c43586c2b96ca16bbce00b5d7e7d67316126db8
 F ext/ota/otafault2.test fa202a98ca221faec318f3e5c5f39485b1256561
-F ext/ota/sqlite3ota.c 9c16cd3bf99d2591a8a0b56b114ebbf839d42399
+F ext/ota/sqlite3ota.c 8c0d30482bf31fe31d3bb565cf8f8271244dd57d
 F ext/ota/sqlite3ota.h f1a9dd98b00fa622c7e2eb68e580ee02e194c4d6
 F ext/ota/test_ota.c e34c801c665d64b4b9e00b71f1acf8c652404b2b
 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
@@ -1269,7 +1269,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P ec9d907a57fcea72c8a64e521e8a1b5777d67568 bd06eeb8d06237dc2d54d8a03e8bf525cb811c9e
-R 6f95f9c15975aab2be755a8183ba89a7
-U drh
-Z 38e5b36fa5e6d50108fc54dc3af0e0b9
+P 9bd3e4453d4ad416f7e3f08f0bd283d34f1c319c
+R 4663dac775a3f1bb6d41bcf6b3ecb7b2
+U dan
+Z 579dc8fee06cffd2aee7945473c8d821
index 3e070661f9448430cefaf34e5bbfc95113acce71..6f939748e39922c20a72c58224e9d50eb9e4d3cf 100644 (file)
@@ -1 +1 @@
-9bd3e4453d4ad416f7e3f08f0bd283d34f1c319c
\ No newline at end of file
+658c3b0c80b9fe7eaac5982573651dc649a4c53f
\ No newline at end of file