]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix some problems with dropped error codes in multiplexOpen().
authordan <dan@noemail.net>
Thu, 15 Dec 2011 11:45:19 +0000 (11:45 +0000)
committerdan <dan@noemail.net>
Thu, 15 Dec 2011 11:45:19 +0000 (11:45 +0000)
FossilOrigin-Name: 2d50f78188e3297e8cefdf73cff51fa0a3b36e65

manifest
manifest.uuid
src/test_multiplex.c

index cd4f6d17383155846736fbc77d0c570f47127573..33561aa1a495d32e9f4b20cd35e70ea440afd370 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C In\sthe\smultiplexor,\sdo\snot\stry\sto\sdelete\soverflow\sfiles\sthat\sdo\snot\sexist.\nAnd\sassume\sall\sbut\sthe\slast\soverflow\sfile\sis\sthe\ssize\sof\sthe\schunk\ssize.
-D 2011-12-15T02:22:16.244
+C Fix\ssome\sproblems\swith\sdropped\serror\scodes\sin\smultiplexOpen().
+D 2011-12-15T11:45:19.350
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5b4a3e12a850b021547e43daf886b25133b44c07
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -214,7 +214,7 @@ F src/test_intarray.h 489edb9068bb926583445cb02589344961054207
 F src/test_journal.c 03313c693cca72959dcaaf79f8d76f21c01e19ff
 F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e
 F src/test_malloc.c 8d416f29ad8573f32601f6056c9d2b17472e9ad5
-F src/test_multiplex.c cee2474efe6ee92732e43184f62422bc17623d1f
+F src/test_multiplex.c 7e8d8303b8ba74ff50fbb40502522e576760266e
 F src/test_multiplex.h e99c571bc4968b7a9363b661481f3934bfead61d
 F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e
 F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec
@@ -978,7 +978,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
 F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
-P 08c1dc517c1340737a55ad9012b7b06f72899c6f
-R 05ea69e1c214c57dec4ba569476ada26
-U drh
-Z 5b0957f1b7fd94c5b03cf783382a1410
+P a822a80d3cfe42b2fca6f8c9ff11762993114a27
+R 4637baef8720406f37351464996699d4
+U dan
+Z a1536baba57190ddd9d59e1c01fe9761
index 18315cb8d5a4276aa28c81ebdad8751032aeb0b7..b07b3ebcac54897571504496cd9f8eff1dd2f669 100644 (file)
@@ -1 +1 @@
-a822a80d3cfe42b2fca6f8c9ff11762993114a27
\ No newline at end of file
+2d50f78188e3297e8cefdf73cff51fa0a3b36e65
\ No newline at end of file
index b9688e34dff6edaef135217c0131cba8fe697d67..f0d495f49171602d43b4de35bed8ccb9284de877 100644 (file)
@@ -466,13 +466,15 @@ static int multiplexOpen(
     rc = multiplexSubFilename(pGroup, 1);
     if( rc==SQLITE_OK ){
       pSubOpen = multiplexSubOpen(pGroup, 0, &rc, pOutFlags);
+      assert( pSubOpen || rc!=SQLITE_OK );
     }
-    if( pSubOpen ){
-      int exists, rc2, rc3;
+    if( rc==SQLITE_OK ){
       sqlite3_int64 sz;
 
-      rc2 = pSubOpen->pMethods->xFileSize(pSubOpen, &sz);
-      if( rc2==SQLITE_OK && zName ){
+      rc = pSubOpen->pMethods->xFileSize(pSubOpen, &sz);
+      if( rc==SQLITE_OK && zName ){
+        int exists;
+
         /* If the first overflow file exists and if the size of the main file
         ** is different from the chunk size, that means the chunk size is set
         ** set incorrectly.  So fix it.
@@ -482,16 +484,18 @@ static int multiplexOpen(
         ** But we have no way of determining the intended chunk size, so 
         ** just disable the multiplexor all togethre.
         */
-        rc3 = pOrigVfs->xAccess(pOrigVfs, pGroup->aReal[1].z,
+        rc = pOrigVfs->xAccess(pOrigVfs, pGroup->aReal[1].z,
             SQLITE_ACCESS_EXISTS, &exists);
-        if( rc3==SQLITE_OK && exists && sz==(sz&0xffff0000) && sz>0
+        if( rc==SQLITE_OK && exists && sz==(sz&0xffff0000) && sz>0
             && sz!=pGroup->szChunk ){
           pGroup->szChunk = sz;
-        }else if( rc3==SQLITE_OK && !exists && sz>pGroup->szChunk ){
+        }else if( rc==SQLITE_OK && !exists && sz>pGroup->szChunk ){
           pGroup->bEnabled = 0;
         }
       }
+    }
 
+    if( rc==SQLITE_OK ){
       if( pSubOpen->pMethods->iVersion==1 ){
         pMultiplexOpen->base.pMethods = &gMultiplex.sIoMethodsV1;
       }else{