]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Remove some redundant and unreachable code.
authordrh <drh@noemail.net>
Tue, 18 Jun 2013 01:52:41 +0000 (01:52 +0000)
committerdrh <drh@noemail.net>
Tue, 18 Jun 2013 01:52:41 +0000 (01:52 +0000)
FossilOrigin-Name: 4c6d58d75d51e1ce829aec214617c3a89e784a2d

manifest
manifest.uuid
src/where.c

index 8f9dc7b01133b4353ac40dab518d2054d09c9921..56a8a23589afa78180a93c67300f54b697f24c99 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\smore\stestcase()\smacros.\s\sFix\sa\smemory\sleak\sfollowing\sOOM\sin\sthe\nvirtual\stable\sanalysis\slogic.
-D 2013-06-17T21:37:40.990
+C Remove\ssome\sredundant\sand\sunreachable\scode.
+D 2013-06-18T01:52:41.578
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -289,7 +289,7 @@ F src/vtab.c b05e5f1f4902461ba9f5fc49bb7eb7c3a0741a83
 F src/wal.c 436bfceb141b9423c45119e68e444358ee0ed35d
 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
 F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73
-F src/where.c b911a484d36d5dca41448e493974368d8147a2e1
+F src/where.c 86cc9705ef7de9ef712619485d3bff3910d58b12
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
 F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
@@ -1096,7 +1096,7 @@ F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/wherecosttest.c f407dc4c79786982a475261866a161cd007947ae
 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P eaf1f1b405ec2c498092527fae00e5dbe9e176c1
-R 7a1603a9005d87a42c0df561c944734f
+P b61402af690ac08b68974f3c807096b0cffd9bc0
+R ddde8ef3fd559d48220a86d476077d7b
 U drh
-Z 30a954d83fb3f9269803abab8ea42340
+Z a276f283a2c7c1a652996ed6754c6f02
index a6139b6aecc98d92ed0b1f2601be03e5c2b5e232..f73027ac71d0bcd70c4cdf1309c9882890b917ac 100644 (file)
@@ -1 +1 @@
-b61402af690ac08b68974f3c807096b0cffd9bc0
\ No newline at end of file
+4c6d58d75d51e1ce829aec214617c3a89e784a2d
\ No newline at end of file
index e3ab83c592e9fbc503bf77dfd07657ffb15b01cb..800194c6ef07cee26052f837921507c0cb3bbcad 100644 (file)
@@ -2041,7 +2041,6 @@ static void constructAutomaticIndex(
   WhereLoop *pLoop;           /* The Loop object */
   Bitmask idxCols;            /* Bitmap of columns used for indexing */
   Bitmask extraCols;          /* Bitmap of additional columns */
-  const int mxConstraint = 10; /* Maximum number of constraints */
 
   /* Generate code to skip over the creation and initialization of the
   ** transient index on 2nd and subsequent iterations of the loop. */
@@ -2056,7 +2055,7 @@ static void constructAutomaticIndex(
   pWCEnd = &pWC->a[pWC->nTerm];
   pLoop = pLevel->pWLoop;
   idxCols = 0;
-  for(pTerm=pWC->a; pTerm<pWCEnd && pLoop->nLTerm<mxConstraint; pTerm++){
+  for(pTerm=pWC->a; pTerm<pWCEnd; pTerm++){
     if( termCanDriveIndex(pTerm, pSrc, notReady) ){
       int iCol = pTerm->u.leftColumn;
       Bitmask cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol);
@@ -3305,6 +3304,7 @@ static Bitmask codeOneLoopStart(
     pStart = pEnd = 0;
     if( pLoop->wsFlags & WHERE_BTM_LIMIT ) pStart = pLoop->aLTerm[j++];
     if( pLoop->wsFlags & WHERE_TOP_LIMIT ) pEnd = pLoop->aLTerm[j++];
+    assert( pStart!=0 || pEnd!=0 );
     if( bRev ){
       pTerm = pStart;
       pStart = pEnd;
@@ -3359,11 +3359,7 @@ static Bitmask codeOneLoopStart(
     pLevel->op = bRev ? OP_Prev : OP_Next;
     pLevel->p1 = iCur;
     pLevel->p2 = start;
-    if( pStart==0 && pEnd==0 ){
-      pLevel->p5 = SQLITE_STMTSTATUS_FULLSCAN_STEP;
-    }else{
-      assert( pLevel->p5==0 );
-    }
+    assert( pLevel->p5==0 );
     if( testOp!=OP_Noop ){
       iRowidReg = iReleaseReg = sqlite3GetTempReg(pParse);
       sqlite3VdbeAddOp2(v, OP_Rowid, iCur, iRowidReg);
@@ -3798,8 +3794,8 @@ static Bitmask codeOneLoopStart(
           ** be available.
           */
           pSubLoop = pSubWInfo->a[0].pWLoop;
+          assert( (pSubLoop->wsFlags & WHERE_TEMP_INDEX)==0 );
           if( (pSubLoop->wsFlags & WHERE_INDEXED)!=0
-           && (pSubLoop->wsFlags & WHERE_TEMP_INDEX)==0
            && (ii==0 || pSubLoop->u.btree.pIndex==pCov)
           ){
             assert( pSubWInfo->a[0].iIdxCur==iCovCur );
@@ -5099,7 +5095,10 @@ static int wherePathSatisfiesOrderBy(
           break;
         }
       } /* end Loop over all index columns */
-      if( distinctColumns ) isOrderDistinct = 1;
+      if( distinctColumns ){
+        testcase( isOrderDistinct==0 );
+        isOrderDistinct = 1;
+      }
     } /* end-if not one-row */
 
     /* Mark off any other ORDER BY terms that reference pLoop */
@@ -5749,7 +5748,7 @@ WhereInfo *sqlite3WhereBegin(
   if( pWInfo->pOrderBy==0 && (db->flags & SQLITE_ReverseOrder)!=0 ){
      pWInfo->revMask = (Bitmask)(-1);
   }
-  if( pParse->nErr || db->mallocFailed ){
+  if( pParse->nErr || NEVER(db->mallocFailed) ){
     goto whereBeginError;
   }
 #ifdef WHERETRACE_ENABLED