Lines Matching refs:pItem
26580 struct SrcList_item *pItem;
26584 pItem = &pSrc->a[k];
26587 if( pItem->zDatabase ){
26588 sqlite3StrAccumAppendAll(pAccum, pItem->zDatabase);
26591 sqlite3StrAccumAppendAll(pAccum, pItem->zName);
27141 struct SrcList_item *pItem = &p->pSrc->a[i];
27145 sqlite3XPrintf(&x, "{%d,*}", pItem->iCursor);
27146 if( pItem->zDatabase ){
27147 sqlite3XPrintf(&x, " %s.%s", pItem->zDatabase, pItem->zName);
27148 }else if( pItem->zName ){
27149 sqlite3XPrintf(&x, " %s", pItem->zName);
27151 if( pItem->pTab ){
27152 sqlite3XPrintf(&x, " tabname=%Q", pItem->pTab->zName);
27154 if( pItem->zAlias ){
27155 sqlite3XPrintf(&x, " (AS %s)", pItem->zAlias);
27157 if( pItem->fg.jointype & JT_LEFT ){
27162 if( pItem->pSelect ){
27163 sqlite3TreeViewSelect(pView, pItem->pSelect, 0);
27165 if( pItem->fg.isTabFunc ){
27166 sqlite3TreeViewExprList(pView, pItem->u1.pFuncArg, 0, "func-args:");
91063 struct ExprList_item *pItem;
91065 for(i=p->nExpr, pItem=p->a; i>0; i--, pItem++){
91066 if( sqlite3WalkExpr(pWalker, pItem->pExpr) ) return WRC_Abort;
91098 struct SrcList_item *pItem;
91102 for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
91103 if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){
91106 if( pItem->fg.isTabFunc
91107 && sqlite3WalkExprList(pWalker, pItem->u1.pFuncArg)
91343 struct SrcList_item *pItem; /* Use for looping over pSrcList items */
91391 for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){
91392 pTab = pItem->pTab;
91395 if( pItem->pSelect && (pItem->pSelect->selFlags & SF_NestedFrom)!=0 ){
91397 pEList = pItem->pSelect->pEList;
91402 pMatch = pItem;
91413 const char *zTabName = pItem->zAlias ? pItem->zAlias : pTab->zName;
91420 pMatch = pItem;
91429 if( pItem->fg.jointype & JT_NATURAL ) continue;
91430 if( nameInUsingClause(pItem->pUsing, zCol) ) continue;
91433 pMatch = pItem;
91662 struct SrcList_item *pItem = &pSrc->a[iSrc];
91663 p->pTab = pItem->pTab;
91664 p->iTable = pItem->iCursor;
91671 pItem->colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol);
91750 struct SrcList_item *pItem;
91752 pItem = pSrcList->a;
91753 assert( HasRowid(pItem->pTab) && pItem->pTab->pSelect==0 );
91755 pExpr->pTab = pItem->pTab;
91756 pExpr->iTable = pItem->iCursor;
92129 struct ExprList_item *pItem;
92133 for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){
92136 if( pItem->done ) continue;
92137 pE = sqlite3ExprSkipCollate(pItem->pExpr);
92161 if( pItem->pExpr==pE ){
92162 pItem->pExpr = pNew;
92164 Expr *pParent = pItem->pExpr;
92171 pItem->u.x.iOrderByCol = (u16)iCol;
92172 pItem->done = 1;
92208 struct ExprList_item *pItem;
92217 for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){
92218 if( pItem->u.x.iOrderByCol ){
92219 if( pItem->u.x.iOrderByCol>pEList->nExpr ){
92223 resolveAlias(pParse, pEList, pItem->u.x.iOrderByCol-1, pItem->pExpr,
92256 struct ExprList_item *pItem; /* A term of the ORDER BY clause */
92263 for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){
92264 Expr *pE = pItem->pExpr;
92273 pItem->u.x.iOrderByCol = (u16)iCol;
92285 pItem->u.x.iOrderByCol = (u16)iCol;
92290 pItem->u.x.iOrderByCol = 0;
92296 pItem->u.x.iOrderByCol = j+1;
92373 struct SrcList_item *pItem = &p->pSrc->a[i];
92374 if( pItem->pSelect ){
92386 if( pItem->zName ) pParse->zAuthContext = pItem->zName;
92387 sqlite3ResolveSelectNames(pParse, pItem->pSelect, pOuterNC);
92392 assert( pItem->fg.isCorrelated==0 && nRef<=0 );
92393 pItem->fg.isCorrelated = (nRef!=0);
92440 struct SrcList_item *pItem = &p->pSrc->a[i];
92441 if( pItem->fg.isTabFunc
92442 && sqlite3ResolveExprListNames(&sNC, pItem->u1.pFuncArg)
92488 struct ExprList_item *pItem;
92493 for(i=0, pItem=pGroupBy->a; i<pGroupBy->nExpr; i++, pItem++){
92494 if( ExprHasProperty(pItem->pExpr, EP_Agg) ){
94018 struct ExprList_item *pItem, *pOldItem;
94026 pItem = pNew->a;
94028 for(i=0; i<p->nExpr; i++, pItem++, pOldItem++){
94031 pItem->pExpr = sqlite3ExprDup(db, pOldExpr, flags);
94034 && (pNewExpr = pItem->pExpr)!=0
94042 assert( pItem[-1].pExpr!=0 );
94043 assert( pNewExpr->iColumn==pItem[-1].pExpr->iColumn+1 );
94044 assert( pPriorSelectCol==pItem[-1].pExpr->pLeft );
94048 pItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
94049 pItem->zSpan = sqlite3DbStrDup(db, pOldItem->zSpan);
94050 pItem->sortOrder = pOldItem->sortOrder;
94051 pItem->done = 0;
94052 pItem->bSpanIsTab = pOldItem->bSpanIsTab;
94053 pItem->u = pOldItem->u;
94194 struct ExprList_item *pItem;
94212 pItem = &pList->a[pList->nExpr++];
94213 assert( offsetof(struct ExprList_item,zName)==sizeof(pItem->pExpr) );
94215 memset(&pItem->zName,0,sizeof(*pItem)-offsetof(struct ExprList_item,zName));
94216 pItem->pExpr = pExpr;
94324 struct ExprList_item *pItem;
94326 pItem = &pList->a[pList->nExpr-1];
94327 assert( pItem->zName==0 );
94328 pItem->zName = sqlite3DbStrNDup(pParse->db, pName->z, pName->n);
94329 if( dequote ) sqlite3Dequote(pItem->zName);
94350 struct ExprList_item *pItem = &pList->a[pList->nExpr-1];
94352 sqlite3DbFree(db, pItem->zSpan);
94353 pItem->zSpan = sqlite3DbSpanDup(db, zStart, zEnd);
94379 struct ExprList_item *pItem = pList->a;
94382 sqlite3ExprDelete(db, pItem->pExpr);
94383 sqlite3DbFree(db, pItem->zName);
94384 sqlite3DbFree(db, pItem->zSpan);
94385 pItem++;
95349 struct ExprList_item *pItem;
95365 for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
95366 Expr *pE2 = pItem->pExpr;
96848 struct ExprList_item *pItem;
96850 for(pItem=p->a, i=p->nExpr; i>0; pItem++, i--){
96851 if( pItem->reusable && sqlite3ExprCompare(0,pItem->pExpr,pExpr,-1)==0 ){
96852 return pItem->u.iConstExprReg;
96859 struct ExprList_item *pItem = &p->a[p->nExpr-1];
96860 pItem->reusable = regDest<0;
96862 pItem->u.iConstExprReg = regDest;
97000 struct ExprList_item *pItem;
97009 for(pItem=pList->a, i=0; i<n; i++, pItem++){
97010 Expr *pExpr = pItem->pExpr;
97011 if( (flags & SQLITE_ECEL_REF)!=0 && (j = pItem->u.x.iOrderByCol)>0 ){
97769 struct SrcList_item *pItem = pSrcList->a;
97770 for(i=0; i<pSrcList->nSrc; i++, pItem++){
97773 if( pExpr->iTable==pItem->iCursor ){
97838 struct AggInfo_func *pItem = pAggInfo->aFunc;
97839 for(i=0; i<pAggInfo->nFunc; i++, pItem++){
97840 if( sqlite3ExprCompare(0, pItem->pExpr, pExpr, -1)==0 ){
97851 pItem = &pAggInfo->aFunc[i];
97852 pItem->pExpr = pExpr;
97853 pItem->iMem = ++pParse->nMem;
97855 pItem->pFunc = sqlite3FindFunction(pParse->db,
97859 pItem->iDistinct = pParse->nTab++;
97861 pItem->iDistinct = -1;
97916 struct ExprList_item *pItem;
97919 for(pItem=pList->a, i=0; i<pList->nExpr; i++, pItem++){
97920 sqlite3ExprAnalyzeAggregates(pNC, pItem->pExpr);
101226 struct SrcList_item *pItem;
101230 for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
101232 if( pItem->zDatabase && sqlite3StrICmp(pItem->zDatabase, zDb) ){
101235 pFix->zType, pFix->pName, pItem->zDatabase);
101238 sqlite3DbFree(pFix->pParse->db, pItem->zDatabase);
101239 pItem->zDatabase = 0;
101240 pItem->pSchema = pFix->pSchema;
101243 if( sqlite3FixSelect(pFix, pItem->pSelect) ) return 1;
101244 if( sqlite3FixExpr(pFix, pItem->pOn) ) return 1;
101311 struct ExprList_item *pItem;
101313 for(i=0, pItem=pList->a; i<pList->nExpr; i++, pItem++){
101314 if( sqlite3FixExpr(pFix, pItem->pExpr) ){
105372 struct SrcList_item *pItem;
105389 pItem = &pList->a[pList->nSrc-1];
105394 pItem->zName = sqlite3NameFromToken(db, pDatabase);
105395 pItem->zDatabase = sqlite3NameFromToken(db, pTable);
105397 pItem->zName = sqlite3NameFromToken(db, pTable);
105398 pItem->zDatabase = 0;
105408 struct SrcList_item *pItem;
105411 for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
105412 if( pItem->iCursor>=0 ) break;
105413 pItem->iCursor = pParse->nTab++;
105414 if( pItem->pSelect ){
105415 sqlite3SrcListAssignCursors(pParse, pItem->pSelect->pSrc);
105426 struct SrcList_item *pItem;
105428 for(pItem=pList->a, i=0; i<pList->nSrc; i++, pItem++){
105429 sqlite3DbFree(db, pItem->zDatabase);
105430 sqlite3DbFree(db, pItem->zName);
105431 sqlite3DbFree(db, pItem->zAlias);
105432 if( pItem->fg.isIndexedBy ) sqlite3DbFree(db, pItem->u1.zIndexedBy);
105433 if( pItem->fg.isTabFunc ) sqlite3ExprListDelete(db, pItem->u1.pFuncArg);
105434 sqlite3DeleteTable(db, pItem->pTab);
105435 sqlite3SelectDelete(db, pItem->pSelect);
105436 sqlite3ExprDelete(db, pItem->pOn);
105437 sqlite3IdListDelete(db, pItem->pUsing);
105468 struct SrcList_item *pItem;
105481 pItem = &p->a[p->nSrc-1];
105484 pItem->zAlias = sqlite3NameFromToken(db, pAlias);
105486 pItem->pSelect = pSubquery;
105487 pItem->pOn = pOn;
105488 pItem->pUsing = pUsing;
105506 struct SrcList_item *pItem;
105508 pItem = &p->a[p->nSrc-1];
105509 assert( pItem->fg.notIndexed==0 );
105510 assert( pItem->fg.isIndexedBy==0 );
105511 assert( pItem->fg.isTabFunc==0 );
105515 pItem->fg.notIndexed = 1;
105517 pItem->u1.zIndexedBy = sqlite3NameFromToken(pParse->db, pIndexedBy);
105518 pItem->fg.isIndexedBy = 1;
105529 struct SrcList_item *pItem = &p->a[p->nSrc-1];
105530 assert( pItem->fg.notIndexed==0 );
105531 assert( pItem->fg.isIndexedBy==0 );
105532 assert( pItem->fg.isTabFunc==0 );
105533 pItem->u1.pFuncArg = pList;
105534 pItem->fg.isTabFunc = 1;
106599 struct SrcList_item *pItem = pSrc->a;
106601 assert( pItem && pSrc->nSrc==1 );
106602 pTab = sqlite3LocateTableItem(pParse, 0, pItem);
106603 sqlite3DeleteTable(pParse->db, pItem->pTab);
106604 pItem->pTab = pTab;
106608 if( sqlite3IndexedByLookup(pParse, pItem) ){
110422 struct SrcList_item *pItem = pSrc->a;
110423 pItem->pTab = pFKey->pFrom;
110424 pItem->zName = pFKey->pFrom->zName;
110425 pItem->pTab->nTabRef++;
110426 pItem->iCursor = pParse->nTab++;
110455 pItem->zName = 0;
112795 struct SrcList_item *pItem; /* An element of pSelect->pSrc */
112869 pItem = pSelect->pSrc->a;
112870 pSrc = sqlite3LocateTableItem(pParse, 0, pItem);
119786 struct ExprList_item *pItem;
119794 for(i=iStart, pItem=pList->a+iStart; i<nExpr; i++, pItem++){
119795 pInfo->aColl[i-iStart] = sqlite3ExprNNCollSeq(pParse, pItem->pExpr);
119796 pInfo->aSortOrder[i-iStart] = pItem->sortOrder;
120671 struct ExprList_item *pItem = &pOrderBy->a[i];
120672 Expr *pTerm = pItem->pExpr;
120678 pColl = multiSelectCollSeq(pParse, p, pItem->u.x.iOrderByCol-1);
121586 struct ExprList_item *pItem;
121587 for(j=0, pItem=pOrderBy->a; j<nOrderBy; j++, pItem++){
121588 assert( pItem->u.x.iOrderByCol>0 );
121589 if( pItem->u.x.iOrderByCol==i ) break;
121611 struct ExprList_item *pItem;
121613 for(i=1, pItem=pOrderBy->a; i<=nOrderBy; i++, pItem++){
121614 assert( pItem->u.x.iOrderByCol>0 );
121615 assert( pItem->u.x.iOrderByCol<=p->pEList->nExpr );
121616 aPermute[i] = pItem->u.x.iOrderByCol - 1;
121924 struct SrcList_item *pItem;
121935 for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
121936 substSelect(pSubst, pItem->pSelect, 1);
121937 if( pItem->fg.isTabFunc ){
121938 substExprList(pSubst, pItem->u1.pFuncArg);
122784 struct SrcList_item *pItem, /* FROM clause element to resolve */
122788 if( pItem->zDatabase==0 && (zName = pItem->zName)!=0 ){
122887 struct SrcList_item *pItem = &pSrc->a[i];
122888 if( pItem->zDatabase==0
122889 && pItem->zName!=0
122890 && 0==sqlite3StrICmp(pItem->zName, pCte->zName)
122892 pItem->pTab = pTab;
122893 pItem->fg.isRecursive = 1;
123526 struct ExprList_item *pItem;
123529 for(j=0, pItem=pList->a; !pColl && j<nArg; j++, pItem++){
123530 pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr);
123679 struct SrcList_item *pItem;
123680 for(pItem = pTabList->a; pItem<pThis; pItem++){
123681 if( pItem->pSelect==0 ) continue;
123682 if( pItem->fg.viaCoroutine ) continue;
123683 if( pItem->zName==0 ) continue;
123684 if( sqlite3_stricmp(pItem->zDatabase, pThis->zDatabase)!=0 ) continue;
123685 if( sqlite3_stricmp(pItem->zName, pThis->zName)!=0 ) continue;
123687 pThis->pSelect->pWhere, pItem->pSelect->pWhere, -1)
123693 return pItem;
123878 struct SrcList_item *pItem = &pTabList->a[i];
123879 Select *pSub = pItem->pSelect;
123880 Table *pTab = pItem->pTab;
123960 struct SrcList_item *pItem = &pTabList->a[i];
123983 if( pItem->colUsed==0 ){
123984 sqlite3AuthCheck(pParse, SQLITE_READ, pItem->zName, "", pItem->zDatabase);
123990 pSub = pItem->pSelect;
123999 if( pItem->addrFillSub ){
124000 if( pItem->fg.viaCoroutine==0 ){
124004 testcase( sqlite3VdbeGetOp(v, pItem->addrFillSub)->opcode==OP_Once );
124005 sqlite3VdbeAddOp2(v, OP_Gosub, pItem->regReturn, pItem->addrFillSub);
124022 if( (pItem->fg.jointype & JT_OUTER)==0
124023 && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor)
124034 pParse->zAuthContext = pItem->zName;
124054 pItem->regReturn = ++pParse->nMem;
124055 sqlite3VdbeAddOp3(v, OP_InitCoroutine, pItem->regReturn, 0, addrTop);
124056 VdbeComment((v, "%s", pItem->pTab->zName));
124057 pItem->addrFillSub = addrTop;
124058 sqlite3SelectDestInit(&dest, SRT_Coroutine, pItem->regReturn);
124059 explainSetInteger(pItem->iSelectId, (u8)pParse->iNextSelectId);
124061 pItem->pTab->nRowLogEst = pSub->nSelectRow;
124062 pItem->fg.viaCoroutine = 1;
124063 pItem->regResult = dest.iSdst;
124064 sqlite3VdbeEndCoroutine(v, pItem->regReturn);
124078 assert( pItem->addrFillSub==0 );
124079 pItem->regReturn = ++pParse->nMem;
124080 topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn);
124081 pItem->addrFillSub = topAddr+1;
124082 if( pItem->fg.isCorrelated==0 ){
124087 VdbeComment((v, "materialize \"%s\"", pItem->pTab->zName));
124089 VdbeNoopComment((v, "materialize \"%s\"", pItem->pTab->zName));
124091 pPrior = isSelfJoinView(pTabList, pItem);
124093 sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pPrior->iCursor);
124094 explainSetInteger(pItem->iSelectId, pPrior->iSelectId);
124098 sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
124099 explainSetInteger(pItem->iSelectId, (u8)pParse->iNextSelectId);
124102 pItem->pTab->nRowLogEst = pSub->nSelectRow;
124104 retAddr = sqlite3VdbeAddOp1(v, OP_Return, pItem->regReturn);
124105 VdbeComment((v, "end %s", pItem->pTab->zName));
124288 struct ExprList_item *pItem; /* For looping over expression in a list */
124290 for(k=p->pEList->nExpr, pItem=p->pEList->a; k>0; k--, pItem++){
124291 pItem->u.x.iAlias = 0;
124293 for(k=pGroupBy->nExpr, pItem=pGroupBy->a; k>0; k--, pItem++){
124294 pItem->u.x.iAlias = 0;
129302 struct SrcList_item *pItem = &pTabList->a[pLevel->iFrom];
129323 if( pItem->pSelect ){
129324 sqlite3XPrintf(&str, " SUBQUERY %d", pItem->iSelectId);
129326 sqlite3XPrintf(&str, " TABLE %s", pItem->zName);
129329 if( pItem->zAlias ){
129330 sqlite3XPrintf(&str, " AS %s", pItem->zAlias);
129339 if( !HasRowid(pItem->pTab) && IsPrimaryKeyIndex(pIdx) ){
132876 struct SrcList_item *pItem, /* The FROM clause term to process */
132884 if( pItem->fg.isTabFunc==0 ) return;
132885 pTab = pItem->pTab;
132887 pArgs = pItem->u1.pFuncArg;
132898 pColRef->iTable = pItem->iCursor;
134664 struct SrcList_item *pItem = pWInfo->pTabList->a + p->iTab;
134665 Table *pTab = pItem->pTab;
134670 pItem->zAlias ? pItem->zAlias : pTab->zName);
136250 struct SrcList_item *pItem;
136256 pItem = pWInfo->pTabList->a + pNew->iTab;
136257 iCur = pItem->iCursor;
136296 if( IsVirtual(pItem->pTab) ){
136365 struct SrcList_item *pItem;
136375 for(iTab=0, pItem=pTabList->a; pItem<pEnd; iTab++, pItem++){
136378 pNew->maskSelf = sqlite3WhereGetMask(&pWInfo->sMaskSet, pItem->iCursor);
136379 if( ((pItem->fg.jointype|priorJointype) & (JT_LEFT|JT_CROSS))!=0 ){
136384 priorJointype = pItem->fg.jointype;
136386 if( IsVirtual(pItem->pTab) ){
136388 for(p=&pItem[1]; p<pEnd; p++){
137185 struct SrcList_item *pItem;
137197 pItem = pWInfo->pTabList->a;
137198 pTab = pItem->pTab;
137200 if( pItem->fg.isIndexedBy ) return 0;
137201 iCur = pItem->iCursor;
137232 if( pIdx->isCovering || (pItem->colUsed & ~columnsInIndex(pIdx))==0 ){
137671 struct SrcList_item *pItem;
137673 pItem = &pWInfo->pTabList->a[pLoop->iTab];
137674 if( (pItem->fg.jointype & JT_LEFT)==0 ) continue;
137685 || pTerm->pExpr->iRightJoinTable!=pItem->iCursor