Lines Matching refs:pSrc

191 static void whereOrMove(WhereOrSet *pDest, WhereOrSet *pSrc){  in whereOrMove()  argument
192 pDest->n = pSrc->n; in whereOrMove()
193 memcpy(pDest->a, pSrc->a, pDest->n*sizeof(pDest->a[0])); in whereOrMove()
761 const SrcItem *pSrc /* Table we are trying to access */ in constraintCompatibleWithOuterJoin() argument
763 assert( (pSrc->fg.jointype&(JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 ); /* By caller */ in constraintCompatibleWithOuterJoin()
764 testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_LEFT ); in constraintCompatibleWithOuterJoin()
765 testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_LTORJ ); in constraintCompatibleWithOuterJoin()
769 || pTerm->pExpr->w.iJoin != pSrc->iCursor in constraintCompatibleWithOuterJoin()
773 if( (pSrc->fg.jointype & (JT_LEFT|JT_RIGHT))!=0 in constraintCompatibleWithOuterJoin()
791 const SrcItem *pSrc, /* Table we are trying to access */ in termCanDriveIndex() argument
795 if( pTerm->leftCursor!=pSrc->iCursor ) return 0; in termCanDriveIndex()
797 assert( (pSrc->fg.jointype & JT_RIGHT)==0 ); in termCanDriveIndex()
798 if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 in termCanDriveIndex()
799 && !constraintCompatibleWithOuterJoin(pTerm,pSrc) in termCanDriveIndex()
806 aff = pSrc->pTab->aCol[pTerm->u.x.leftColumn].affinity; in termCanDriveIndex()
823 const SrcItem *pSrc, /* The FROM clause term to get the next index */ in constructAutomaticIndex() argument
860 pTable = pSrc->pTab; in constructAutomaticIndex()
870 && sqlite3ExprIsTableConstraint(pExpr, pSrc) in constructAutomaticIndex()
875 if( termCanDriveIndex(pTerm, pSrc, notReady) ){ in constructAutomaticIndex()
911 extraCols = pSrc->colUsed & (~idxCols | MASKBIT(BMS-1)); in constructAutomaticIndex()
918 if( pSrc->colUsed & MASKBIT(BMS-1) ){ in constructAutomaticIndex()
931 if( termCanDriveIndex(pTerm, pSrc, notReady) ){ in constructAutomaticIndex()
961 if( pSrc->colUsed & MASKBIT(BMS-1) ){ in constructAutomaticIndex()
1171 SrcItem *pSrc, /* The FROM clause term that is the vtab */ in allocateIndexInfo() argument
1189 assert( pSrc!=0 ); in allocateIndexInfo()
1190 pTab = pSrc->pTab; in allocateIndexInfo()
1200 if( pTerm->leftCursor != pSrc->iCursor ) continue; in allocateIndexInfo()
1213 if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 in allocateIndexInfo()
1214 && !constraintCompatibleWithOuterJoin(pTerm,pSrc) in allocateIndexInfo()
1242 if( pExpr->op==TK_COLUMN && pExpr->iTable==pSrc->iCursor ){ in allocateIndexInfo()
1251 && pE2->iTable==pSrc->iCursor in allocateIndexInfo()
2786 SrcItem *pSrc, /* FROM clause term being analyzed */ in whereLoopAddBtreeIndex() argument
2838 pTerm = whereScanInit(&scan, pBuilder->pWC, pSrc->iCursor, saved_nEq, in whereLoopAddBtreeIndex()
2862 if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 in whereLoopAddBtreeIndex()
2863 && !constraintCompatibleWithOuterJoin(pTerm,pSrc) in whereLoopAddBtreeIndex()
2976 pParse, pSrc->iCursor, pProbe, saved_nEq, pTerm in whereLoopAddBtreeIndex()
3094 assert( pSrc->pTab->szTabRow>0 ); in whereLoopAddBtreeIndex()
3095 rCostIdx = pNew->nOut + 1 + (15*pProbe->szIdxRow)/pSrc->pTab->szTabRow; in whereLoopAddBtreeIndex()
3119 whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nInMul+nIn); in whereLoopAddBtreeIndex()
3165 whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter + nInMul); in whereLoopAddBtreeIndex()
3384 SrcItem *pSrc; /* The FROM clause btree term to add */ in whereLoopAddBtree() local
3396 pSrc = pTabList->a + pNew->iTab; in whereLoopAddBtree()
3397 pTab = pSrc->pTab; in whereLoopAddBtree()
3399 assert( !IsVirtual(pSrc->pTab) ); in whereLoopAddBtree()
3401 if( pSrc->fg.isIndexedBy ){ in whereLoopAddBtree()
3402 assert( pSrc->fg.isCte==0 ); in whereLoopAddBtree()
3404 pProbe = pSrc->u2.pIBIndex; in whereLoopAddBtree()
3424 pFirst = pSrc->pTab->pIndex; in whereLoopAddBtree()
3425 if( pSrc->fg.notIndexed==0 ){ in whereLoopAddBtree()
3439 && !pSrc->fg.isIndexedBy /* Has no INDEXED BY clause */ in whereLoopAddBtree()
3440 && !pSrc->fg.notIndexed /* Has no NOT INDEXED clause */ in whereLoopAddBtree()
3442 && !pSrc->fg.isCorrelated /* Not a correlated subquery */ in whereLoopAddBtree()
3443 && !pSrc->fg.isRecursive /* Not a recursive common table expression. */ in whereLoopAddBtree()
3444 && (pSrc->fg.jointype & JT_RIGHT)==0 /* Not the right tab of a RIGHT JOIN */ in whereLoopAddBtree()
3453 if( termCanDriveIndex(pTerm, pSrc, 0) ){ in whereLoopAddBtree()
3492 pProbe=(pSrc->fg.isIndexedBy ? 0 : pProbe->pNext), iSortIdx++ in whereLoopAddBtree()
3495 && !whereUsablePartialIndex(pSrc->iCursor, pSrc->fg.jointype, pWC, in whereLoopAddBtree()
3498 testcase( pNew->iTab!=pSrc->iCursor ); /* See ticket [98d973b8f5] */ in whereLoopAddBtree()
3513 b = indexMightHelpWithOrderBy(pBuilder, pProbe, pSrc->iCursor); in whereLoopAddBtree()
3554 m = pSrc->colUsed & pProbe->colNotIdxed; in whereLoopAddBtree()
3556 m = whereIsCoveringIndex(pWInfo, pProbe, pSrc->iCursor); in whereLoopAddBtree()
3565 || pSrc->fg.isIndexedBy in whereLoopAddBtree()
3588 int iCur = pSrc->iCursor; in whereLoopAddBtree()
3609 if( (pSrc->fg.jointype & JT_RIGHT)!=0 && pProbe->aColExpr ){ in whereLoopAddBtree()
3623 rc = whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, 0); in whereLoopAddBtree()
3690 SrcItem *pSrc = &pBuilder->pWInfo->pTabList->a[pNew->iTab]; in whereLoopAddVirtualOne() local
3720 pIdxInfo->colUsed = (sqlite3_int64)pSrc->colUsed; in whereLoopAddVirtualOne()
3724 rc = vtabBestIndex(pParse, pSrc->pTab, pIdxInfo); in whereLoopAddVirtualOne()
3753 sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName); in whereLoopAddVirtualOne()
3814 sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName); in whereLoopAddVirtualOne()
4004 SrcItem *pSrc; /* The FROM clause term to search */ in whereLoopAddVirtual() local
4018 pSrc = &pWInfo->pTabList->a[pNew->iTab]; in whereLoopAddVirtual()
4019 assert( IsVirtual(pSrc->pTab) ); in whereLoopAddVirtual()
4020 p = allocateIndexInfo(pWInfo, pWC, mUnusable, pSrc, &mNoOmit); in whereLoopAddVirtual()
4033 WHERETRACE(0x800, ("BEGIN %s.addVirtual()\n", pSrc->pTab->zName)); in whereLoopAddVirtual()
4117 WHERETRACE(0x800, ("END %s.addVirtual(), rc=%d\n", pSrc->pTab->zName, rc)); in whereLoopAddVirtual()
5828 sSelect.pSrc = pTabList; in sqlite3WhereBegin()
6161 SrcItem *pSrc; in sqlite3WhereBegin() local
6165 pSrc = &pTabList->a[pLevel->iFrom]; in sqlite3WhereBegin()
6166 if( pSrc->fg.isMaterialized ){ in sqlite3WhereBegin()
6167 if( pSrc->fg.isCorrelated ){ in sqlite3WhereBegin()
6168 sqlite3VdbeAddOp2(v, OP_Gosub, pSrc->regReturn, pSrc->addrFillSub); in sqlite3WhereBegin()
6171 sqlite3VdbeAddOp2(v, OP_Gosub, pSrc->regReturn, pSrc->addrFillSub); in sqlite3WhereBegin()