]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Bug fixes in the solver.
authordrh <drh@noemail.net>
Wed, 8 May 2013 03:22:07 +0000 (03:22 +0000)
committerdrh <drh@noemail.net>
Wed, 8 May 2013 03:22:07 +0000 (03:22 +0000)
FossilOrigin-Name: b36034bbd19bc5677b26a6f60ca96eb2b37db373

manifest
manifest.uuid
src/where.c

index 53780d9f2742eb2cb7e34012d1ca36886005f19d..7b52c55ce197372eaa4e4fb58cc5b065eb59a97d 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sthe\sNGQP\ssolver.
-D 2013-05-08T03:05:41.388
+C Bug\sfixes\sin\sthe\ssolver.
+D 2013-05-08T03:22:07.536
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in ce81671efd6223d19d4c8c6b88ac2c4134427111
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -263,7 +263,7 @@ F src/vtab.c b05e5f1f4902461ba9f5fc49bb7eb7c3a0741a83
 F src/wal.c 436bfceb141b9423c45119e68e444358ee0ed35d
 F src/wal.h a4d3da523d55a226a0b28e9058ef88d0a8051887
 F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73
-F src/where.c cac7c10d422ece684740285366285ef06529796f
+F src/where.c 22da73b779e8892a59fcd03835ddf7c3e63a305c
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
 F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
@@ -1060,7 +1060,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 15cc8a16482777d8e138c4d0863faf8d54fef33a
-R 6dc017dbdcd8ab4e7013a1e96308cbfe
+P 5d37587c50d8932b6357bfd03152a851510a4317
+R 0e4e284cdf8cf22ac3d57735e7fe3f80
 U drh
-Z 6f2b95a5959d577b5b6c3e6985beb9a5
+Z bad1f86f1f7d261e6176b4a4726658c0
index 379ce7b07e95f4479bdc85cbbac0b6959b2ee7cf..27876fbc73743bd33e0bb7bd9d3708ab880e4b7d 100644 (file)
@@ -1 +1 @@
-5d37587c50d8932b6357bfd03152a851510a4317
\ No newline at end of file
+b36034bbd19bc5677b26a6f60ca96eb2b37db373
\ No newline at end of file
index e87d2ae643c093efbe13552d798bf868f756c859..abd99f5a84b28948eef59f3a6a273a2221df5e6f 100644 (file)
@@ -5443,6 +5443,7 @@ static int wherePathSolver(WhereInfo *pWInfo){
     pFrom->aLoop = pX;
   }
 
+  aFrom[0].nRow = (double)1;
   nFrom = 1;
   for(iLoop=0; iLoop<nLoop; iLoop++){
     nTo = 0;
@@ -5462,6 +5463,8 @@ static int wherePathSolver(WhereInfo *pWInfo){
             for(jj=nTo-1; aTo[jj].rCost>=mxCost; jj++){ assert(jj>0); }
           }
           pTo = &aTo[jj];
+        }else{
+          if( pTo->rCost<=rCost ) continue;
         }
         pTo->maskLoop = pFrom->maskLoop | pWLoop->maskSelf;
         pTo->nRow = pFrom->nRow * pWLoop->nOut;
@@ -5477,6 +5480,19 @@ static int wherePathSolver(WhereInfo *pWInfo){
       }
     }
 
+#if 0
+    if( sqlite3WhereTrace ){
+      sqlite3DebugPrintf("---- round %d ---- nTo=%d\n", iLoop, nTo);
+      for(ii=0; ii<nTo; ii++){
+        sqlite3DebugPrintf("%03d:  cost=%g  nrow=%g\n",
+           ii, aTo[ii].rCost, aTo[ii].nRow);
+        for(jj=0; jj<=iLoop; jj++){
+          whereLoopPrint(aTo[ii].aLoop[jj], pWInfo->pTabList);
+        }
+      }
+    }
+#endif
+
     /* Swap the roles of aFrom and aTo in preparation for the next
     ** cycle. */
     pFrom = aTo;