/ Check-in [8d2ae8e2]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Additional compiler warning fixes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | nextgen-query-plan-exp
Files: files | file ages | folders
SHA1: 8d2ae8e2f343f82f6fba6d0e89cee7f15b444aa3
User & Date: drh 2013-06-19 13:59:49
Context
2013-06-19
18:01
Add in the cost of doing a table lookup on OR searches. Make test case changes to deal with difference in STAT3 behavior. check-in: d97898e8 user: drh tags: nextgen-query-plan-exp
13:59
Additional compiler warning fixes. check-in: 8d2ae8e2 user: drh tags: nextgen-query-plan-exp
13:32
Fix a harmless uninitialized variable warning. check-in: 9d3ef3bd user: drh tags: nextgen-query-plan-exp
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/build.c.

  3183   3183                  sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) );
  3184   3184       if( pNew==0 ){
  3185   3185         assert( db->mallocFailed );
  3186   3186         return pSrc;
  3187   3187       }
  3188   3188       pSrc = pNew;
  3189   3189       nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1;
  3190         -    pSrc->nAlloc = (u16)nGot;
         3190  +    pSrc->nAlloc = (u8)nGot;
  3191   3191     }
  3192   3192   
  3193   3193     /* Move existing slots that come after the newly inserted slots
  3194   3194     ** out of the way */
  3195   3195     for(i=pSrc->nSrc-1; i>=iStart; i--){
  3196   3196       pSrc->a[i+nExtra] = pSrc->a[i];
  3197   3197     }
  3198         -  pSrc->nSrc += (i16)nExtra;
         3198  +  pSrc->nSrc += (i8)nExtra;
  3199   3199   
  3200   3200     /* Zero the newly allocated slots */
  3201   3201     memset(&pSrc->a[iStart], 0, sizeof(pSrc->a[0])*nExtra);
  3202   3202     for(i=iStart; i<iStart+nExtra; i++){
  3203   3203       pSrc->a[i].iCursor = -1;
  3204   3204     }
  3205   3205   

Changes to src/where.c.

   879    879                 continue;
   880    880               }
   881    881               pScan->k = k+1;
   882    882               return pTerm;
   883    883             }
   884    884           }
   885    885         }
   886         -      pWC = pScan->pWC = pScan->pWC->pOuter;
          886  +      pScan->pWC = pScan->pWC->pOuter;
   887    887         k = 0;
   888    888       }
   889    889       pScan->pWC = pScan->pOrigWC;
   890    890       k = 0;
   891    891       pScan->iEquiv += 2;
   892    892     }
   893    893     return 0;
................................................................................
  3429   3429       int nExtraReg = 0;           /* Number of extra registers needed */
  3430   3430       int op;                      /* Instruction opcode */
  3431   3431       char *zStartAff;             /* Affinity for start of range constraint */
  3432   3432       char *zEndAff;               /* Affinity for end of range constraint */
  3433   3433   
  3434   3434       pIdx = pLoop->u.btree.pIndex;
  3435   3435       iIdxCur = pLevel->iIdxCur;
  3436         -    k = (nEq==pIdx->nColumn ? -1 : pIdx->aiColumn[nEq]);
  3437   3436   
  3438   3437       /* If this loop satisfies a sort order (pOrderBy) request that 
  3439   3438       ** was passed to this function to implement a "SELECT min(x) ..." 
  3440   3439       ** query, then the caller will only allow the loop to run for
  3441   3440       ** a single iteration. This means that the first row returned
  3442   3441       ** should not have a NULL value stored in 'x'. If column 'x' is
  3443   3442       ** the first one after the nEq equality constraints in the index,
................................................................................
  3683   3682       if( pWInfo->nLevel>1 ){
  3684   3683         int nNotReady;                 /* The number of notReady tables */
  3685   3684         struct SrcList_item *origSrc;     /* Original list of tables */
  3686   3685         nNotReady = pWInfo->nLevel - iLevel - 1;
  3687   3686         pOrTab = sqlite3StackAllocRaw(pParse->db,
  3688   3687                               sizeof(*pOrTab)+ nNotReady*sizeof(pOrTab->a[0]));
  3689   3688         if( pOrTab==0 ) return notReady;
  3690         -      pOrTab->nAlloc = (i16)(nNotReady + 1);
         3689  +      pOrTab->nAlloc = (u8)(nNotReady + 1);
  3691   3690         pOrTab->nSrc = pOrTab->nAlloc;
  3692   3691         memcpy(pOrTab->a, pTabItem, sizeof(*pTabItem));
  3693   3692         origSrc = pWInfo->pTabList->a;
  3694   3693         for(k=1; k<=nNotReady; k++){
  3695   3694           memcpy(&pOrTab->a[k], &origSrc[pLevel[k].iFrom], sizeof(pOrTab->a[k]));
  3696   3695         }
  3697   3696       }else{
................................................................................
  4342   4341           testcase( pTerm->eOperator & WO_EQ );
  4343   4342           testcase( pTerm->eOperator & WO_ISNULL );
  4344   4343           rc = whereEqualScanEst(pParse, pProbe, pTerm->pExpr->pRight, &nOut);
  4345   4344         }else if( (pTerm->eOperator & WO_IN)
  4346   4345                &&  !ExprHasProperty(pTerm->pExpr, EP_xIsSelect)  ){
  4347   4346           rc = whereInScanEst(pParse, pProbe, pTerm->pExpr->x.pList, &nOut);
  4348   4347         }
  4349         -      pNew->nOut = whereCost(nOut);
         4348  +      if( rc==SQLITE_OK ) pNew->nOut = whereCost(nOut);
  4350   4349       }
  4351   4350   #endif
  4352   4351       if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK))==0 ){
  4353   4352         /* Each row involves a step of the index, then a binary search of
  4354   4353         ** the main table */
  4355   4354         pNew->rRun =  whereCostAdd(pNew->rRun, rLogSize>27 ? rLogSize-17 : 10);
  4356   4355       }