Lines Matching refs:pSrc
19508 SrcList *pSrc; /* The FROM clause */ member
32769 SQLITE_PRIVATE void sqlite3TreeViewSrcList(TreeView *pView, const SrcList *pSrc){ in sqlite3TreeViewSrcList() argument
32771 if( pSrc==0 ) return; in sqlite3TreeViewSrcList()
32772 for(i=0; i<pSrc->nSrc; i++){ in sqlite3TreeViewSrcList()
32773 const SrcItem *pItem = &pSrc->a[i]; in sqlite3TreeViewSrcList()
32815 sqlite3TreeViewItem(pView, zLine, i<pSrc->nSrc-1); in sqlite3TreeViewSrcList()
32824 sqlite3TreeViewPush(&pView, i+1<pSrc->nSrc); in sqlite3TreeViewSrcList()
32873 if( p->pSrc && p->pSrc->nSrc ) n++; in sqlite3TreeViewSelect()
32899 if( p->pSrc && p->pSrc->nSrc ){ in sqlite3TreeViewSelect()
32902 sqlite3TreeViewSrcList(pView, p->pSrc); in sqlite3TreeViewSelect()
72120 static void ptrmapPutOvflPtr(MemPage *pPage, MemPage *pSrc, u8 *pCell,int *pRC){
72127 if( SQLITE_OVERFLOW(pSrc->aDataEnd, pCell, pCell+info.nLocal) ){
72128 testcase( pSrc!=pPage );
77525 const u8 *pSrc;
77546 pSrc = pX->pData;
77554 pSrc = pX->pKey;
77573 memcpy(pPayload, pSrc, nSrc);
77631 memcpy(pPayload, pSrc, n);
77634 memcpy(pPayload, pSrc, n);
77641 pSrc += n;
80155 SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor *pDest, BtCursor *pSrc, i64 iKey){
80162 getCellInfo(pSrc);
80163 if( pSrc->info.nPayload<0x80 ){
80164 *(aOut++) = pSrc->info.nPayload;
80166 aOut += sqlite3PutVarint(aOut, pSrc->info.nPayload);
80169 nIn = pSrc->info.nLocal;
80170 aIn = pSrc->info.pPayload;
80171 if( aIn+nIn>pSrc->pPage->aDataEnd ){
80172 return SQLITE_CORRUPT_PAGE(pSrc->pPage);
80174 nRem = pSrc->info.nPayload;
80181 Pager *pSrcPager = pSrc->pBt->pPager;
80188 nOut = btreePayloadToLocal(pDest->pPage, pSrc->info.nPayload);
80190 if( nOut<pSrc->info.nPayload ){
80196 if( aIn+nIn+4>pSrc->pPage->aDataEnd ){
80197 return SQLITE_CORRUPT_PAGE(pSrc->pPage);
80199 ovflIn = get4byte(&pSrc->info.pPayload[nIn]);
80222 nIn = pSrc->pBt->usableSize - 4;
82041 Btree *pSrc; /* Source b-tree file */
82126 rc = sqlite3BtreeSetPageSize(p->pDest,sqlite3BtreeGetPageSize(p->pSrc),0,0);
82196 p->pSrc = findBtree(pDestDb, pSrcDb, zSrcDb);
82203 if( 0==p->pSrc || 0==p->pDest
82216 p->pSrc->nBackup++;
82245 const int nSrcPgsz = sqlite3BtreeGetPageSize(p->pSrc);
82252 assert( sqlite3BtreeGetReserveNoMutex(p->pSrc)>=0 );
82255 assert( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) );
82284 sqlite3Put4byte(&zOut[28], sqlite3BtreeLastPage(p->pSrc));
82316 assert( sqlite3BtreeHoldsMutex(p->pSrc) );
82317 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
82336 sqlite3BtreeEnter(p->pSrc);
82343 Pager * const pSrcPager = sqlite3BtreePager(p->pSrc); /* Source pager */
82352 if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){
82362 if( rc==SQLITE_OK && SQLITE_TXN_NONE==sqlite3BtreeTxnState(p->pSrc) ){
82363 rc = sqlite3BtreeBeginTrans(p->pSrc, 0, 0);
82387 pgszSrc = sqlite3BtreeGetPageSize(p->pSrc);
82400 nSrcPage = (int)sqlite3BtreeLastPage(p->pSrc);
82404 if( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ){
82459 assert( pgszSrc==sqlite3BtreeGetPageSize(p->pSrc) );
82562 TESTONLY( rc2 = ) sqlite3BtreeCommitPhaseOne(p->pSrc, 0);
82563 TESTONLY( rc2 |= ) sqlite3BtreeCommitPhaseTwo(p->pSrc, 0);
82575 sqlite3BtreeLeave(p->pSrc);
82592 sqlite3BtreeEnter(p->pSrc);
82599 p->pSrc->nBackup--;
82602 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
82622 sqlite3BtreeLeave(p->pSrc);
82680 assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
82716 assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
82753 b.pSrc = pFrom;
98868 VdbeCursor *pSrc; /* Cursor to read from */
98875 pSrc = p->apCsr[pOp->p2];
98877 rc = sqlite3BtreeTransferRow(pDest->uc.pCursor, pSrc->uc.pCursor, iKey);
106629 SrcList *pSrc;
106633 pSrc = p->pSrc;
106634 if( ALWAYS(pSrc) ){
106635 for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
107592 SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){
107595 SrcItem *pItem = &pSrc->a[iSrc];
108239 nc.pSrcList = pSelect->pSrc;
108607 Select *pSub = p->pSrc->a[0].pSelect;
108608 assert( p->pSrc->nSrc==1 && p->pOrderBy );
108617 for(i=0; i<p->pSrc->nSrc; i++){
108618 SrcItem *pItem = &p->pSrc->a[i];
108650 sNC.pSrcList = p->pSrc;
108693 for(i=0; i<p->pSrc->nSrc; i++){
108694 SrcItem *pItem = &p->pSrc->a[i];
108727 Select *pSub = p->pSrc->a[0].pSelect;
110954 pNew->pSrc = sqlite3SrcListDup(db, p->pSrc, flags);
111668 const SrcItem *pSrc = &pSrcList->a[iSrc];
111669 if( pSrc->fg.jointype & JT_LTORJ ){
111672 if( pSrc->fg.jointype & JT_LEFT ){
111674 if( pExpr->w.iJoin!=pSrc->iCursor ) return 0; /* rule (4b) */
111692 return sqlite3ExprIsTableConstant(pExpr, pSrc->iCursor, bAllowSubq);
111965 SrcList *pSrc;
111981 pSrc = p->pSrc;
111982 assert( pSrc!=0 );
111983 if( pSrc->nSrc!=1 ) return 0; /* Single term in FROM clause */
111984 if( pSrc->a[0].pSelect ) return 0; /* FROM is not a subquery or view */
111985 pTab = pSrc->a[0].pTab;
111995 assert( pRes->iTable==pSrc->a[0].iCursor ); /* Not a correlated subquery */
112167 assert( p->pSrc!=0 ); /* Because of isCandidateForInOpt(p) */
112168 pTab = p->pSrc->a[0].pTab;
115562 SrcList *pSrc = pSelect->pSrc;
115565 if( pSrc->nSrc==0 ) return WRC_Continue;
115567 p->nExclude += pSrc->nSrc;
115575 for(i=0; i<pSrc->nSrc; i++, j++){
115576 p->aiExclude[j] = pSrc->a[i].iCursor;
115582 SrcList *pSrc = pSelect->pSrc;
115584 assert( p->nExclude>=pSrc->nSrc );
115585 p->nExclude -= pSrc->nSrc;
115603 SrcList *pSrc = p->pRef;
115604 int nSrc = pSrc ? pSrc->nSrc : 0;
115606 if( pExpr->iTable==pSrc->a[i].iCursor ){
116268 SrcList *pSrc, /* The table to rename. */
116282 assert( pSrc->nSrc==1 );
116285 pTab = sqlite3LocateTableItem(pParse, 0, &pSrc->a[0]);
116427 sqlite3SrcListDelete(db, pSrc);
116625 SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
116637 pTab = sqlite3LocateTableItem(pParse, 0, &pSrc->a[0]);
116695 sqlite3SrcListDelete(db, pSrc);
116740 SrcList *pSrc, /* Table being altered. pSrc->nSrc==1 */
116754 pTab = sqlite3LocateTableItem(pParse, 0, &pSrc->a[0]);
116820 sqlite3SrcListDelete(db, pSrc);
117036 if( ALWAYS(p->pSrc) ){ /* Every Select as a SrcList, even if it is empty */
117037 SrcList *pSrc = p->pSrc;
117038 for(i=0; i<pSrc->nSrc; i++){
117039 sqlite3RenameTokenRemap(pParse, 0, (void*)pSrc->a[i].zName);
117040 if( pSrc->a[i].fg.isUsing==0 ){
117041 sqlite3WalkExpr(pWalker, pSrc->a[i].u3.pOn);
117043 unmapColumnIdlistNames(pParse, pSrc->a[i].u3.pUsing);
117479 SrcList *pSrc = sqlite3TriggerStepSrc(pParse, pStep);
117480 if( pSrc ){
117482 pParse, pStep->pExprList, pSrc, 0, 0, 0, 0, 0, 0
117486 pSrc = 0;
117502 assert( pSrc==pSel->pSrc );
117504 pSel->pSrc = 0;
117520 sNC.pSrcList = pSrc;
117530 pUpsert->pUpsertSrc = pSrc;
117547 sqlite3SrcListDelete(db, pSrc);
117816 SrcList *pSrc = pSelect->pSrc;
117822 if( NEVER(pSrc==0) ){
117826 for(i=0; i<pSrc->nSrc; i++){
117827 SrcItem *pItem = &pSrc->a[i];
118296 SQLITE_PRIVATE void sqlite3AlterDropColumn(Parse *pParse, SrcList *pSrc, const Token *pName){
118308 pTab = sqlite3LocateTableItem(pParse, 0, &pSrc->a[0]);
118437 sqlite3SrcListDelete(db, pSrc);
120954 SrcList *pList = pSelect->pSrc;
121041 s.pSrc = pList;
124503 sqlite3SrcListAssignCursors(pParse, pSel->pSrc);
126142 SrcList *pSrc, /* The SrcList to be enlarged */
126151 assert( pSrc!=0 );
126152 assert( iStart<=pSrc->nSrc );
126155 if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){
126157 sqlite3_int64 nAlloc = 2*(sqlite3_int64)pSrc->nSrc+nExtra;
126160 if( pSrc->nSrc+nExtra>=SQLITE_MAX_SRCLIST ){
126166 pNew = sqlite3DbRealloc(db, pSrc,
126167 sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) );
126172 pSrc = pNew;
126173 pSrc->nAlloc = nAlloc;
126178 for(i=pSrc->nSrc-1; i>=iStart; i--){
126179 pSrc->a[i+nExtra] = pSrc->a[i];
126181 pSrc->nSrc += nExtra;
126184 memset(&pSrc->a[iStart], 0, sizeof(pSrc->a[0])*nExtra);
126186 pSrc->a[i].iCursor = -1;
126190 return pSrc;
126283 sqlite3SrcListAssignCursors(pParse, pItem->pSelect->pSrc);
127648 SQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){
127649 SrcItem *pItem = pSrc->a;
127651 assert( pItem && pSrc->nSrc>=1 );
127799 SrcList *pSrc, /* the FROM clause -- which tables to scan */
127838 pTab = pSrc->a[0].pTab;
127871 pSrc->a[0].pTab = 0;
127872 pSelectSrc = sqlite3SrcListDup(db, pSrc, 0);
127873 pSrc->a[0].pTab = pTab;
127874 if( pSrc->a[0].fg.isIndexedBy ){
127875 assert( pSrc->a[0].fg.isCte==0 );
127876 pSrc->a[0].u2.pIBIndex = 0;
127877 pSrc->a[0].fg.isIndexedBy = 0;
127878 sqlite3DbFree(db, pSrc->a[0].u1.zIndexedBy);
127879 }else if( pSrc->a[0].fg.isCte ){
127880 pSrc->a[0].u2.pCteUse->nUse++;
131957 SrcList *pSrc, /* The child table to be scanned */
132028 pRight = exprTableColumn(db, pTab, pSrc->a[0].iCursor, -1);
132048 sNameContext.pSrcList = pSrc;
132056 pWInfo = sqlite3WhereBegin(pParse, pSrc, pWhere, 0, 0, 0, 0, 0);
132427 SrcList *pSrc;
132451 pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
132452 if( pSrc ){
132453 SrcItem *pItem = pSrc->a;
132460 fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regNew, -1);
132466 fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regOld, 1);
132489 sqlite3SrcListDelete(db, pSrc);
132736 SrcList *pSrc;
132743 pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
132744 if( pSrc ){
132745 assert( pSrc->nSrc==1 );
132746 pSrc->a[0].zName = sqlite3DbStrDup(db, zFrom);
132747 pSrc->a[0].zDatabase = sqlite3DbStrDup(db, db->aDb[iDb].zDbSName);
132751 pSrc,
133479 if( ALWAYS(pVal) && pVal->pSrc->nSrc>0 ){
133480 SrcItem *pItem = &pVal->pSrc->a[0];
133571 || (pLeft->pSrc->nSrc==0 &&
133578 if( pLeft->pSrc->nSrc ){
133595 if( pLeft->pSrc->nSrc==0 ){
133610 pRet->pSrc->nSrc = 1;
133618 p = &pRet->pSrc->a[0];
133644 p = &pLeft->pSrc->a[0];
134001 if( pSelect->pSrc->nSrc==1
134002 && pSelect->pSrc->a[0].fg.viaCoroutine
134005 SrcItem *pItem = &pSelect->pSrc->a[0];
135824 static int xferCompatibleIndex(Index *pDest, Index *pSrc){
135826 assert( pDest && pSrc );
135827 assert( pDest->pTable!=pSrc->pTable );
135828 if( pDest->nKeyCol!=pSrc->nKeyCol || pDest->nColumn!=pSrc->nColumn ){
135831 if( pDest->onError!=pSrc->onError ){
135834 for(i=0; i<pSrc->nKeyCol; i++){
135835 if( pSrc->aiColumn[i]!=pDest->aiColumn[i] ){
135838 if( pSrc->aiColumn[i]==XN_EXPR ){
135839 assert( pSrc->aColExpr!=0 && pDest->aColExpr!=0 );
135840 if( sqlite3ExprCompare(0, pSrc->aColExpr->a[i].pExpr,
135845 if( pSrc->aSortOrder[i]!=pDest->aSortOrder[i] ){
135848 if( sqlite3_stricmp(pSrc->azColl[i],pDest->azColl[i])!=0 ){
135852 if( sqlite3ExprCompare(0, pSrc->pPartIdxWhere, pDest->pPartIdxWhere, -1) ){
135894 Table *pSrc; /* The table in the FROM clause of SELECT */
135924 assert(pSelect->pSrc); /* allocated even if there is no FROM clause */
135925 if( pSelect->pSrc->nSrc!=1 ){
135928 if( pSelect->pSrc->a[0].pSelect ){
135965 pItem = pSelect->pSrc->a;
135966 pSrc = sqlite3LocateTableItem(pParse, 0, pItem);
135967 if( pSrc==0 ){
135970 if( pSrc->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){
135971 testcase( pSrc!=pDest ); /* Possible due to bad sqlite_schema.rootpage */
135974 if( HasRowid(pDest)!=HasRowid(pSrc) ){
135977 if( !IsOrdinaryTable(pSrc) ){
135980 if( pDest->nCol!=pSrc->nCol ){
135983 if( pDest->iPKey!=pSrc->iPKey ){
135986 if( (pDest->tabFlags & TF_Strict)!=0 && (pSrc->tabFlags & TF_Strict)==0 ){
135991 Column *pSrcCol = &pSrc->aCol[i];
136026 sqlite3ColumnExpr(pSrc, pSrcCol),
136047 Expr *pSrcExpr = sqlite3ColumnExpr(pSrc, pSrcCol);
136064 for(pSrcIdx=pSrc->pIndex; pSrcIdx; pSrcIdx=pSrcIdx->pNext){
136070 if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema
136081 && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1)
136110 iDbSrc = sqlite3SchemaToIndex(db, pSrc->pSchema);
136147 if( HasRowid(pSrc) ){
136149 sqlite3OpenTable(pParse, iSrc, iDbSrc, pSrc, OP_OpenRead);
136194 sqlite3TableLock(pParse, iDbSrc, pSrc->tnum, 0, pSrc->zName);
136198 for(pSrcIdx=pSrc->pIndex; ALWAYS(pSrcIdx); pSrcIdx=pSrcIdx->pNext){
136234 }else if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){
142978 sqlite3SrcListDelete(db, p->pSrc);
143020 SrcList *pSrc, /* the FROM clause -- which tables to scan */
143048 if( pSrc==0 ) pSrc = sqlite3DbMallocZero(pParse->db, sizeof(*pSrc));
143049 pNew->pSrc = pSrc;
143066 assert( pNew->pSrc!=0 || pParse->nErr>0 );
143248 SrcList *pSrc, /* Array of tables to search */
143259 assert( iEnd<pSrc->nSrc );
143264 iCol = sqlite3ColumnIndex(pSrc->a[i].pTab, zCol);
143266 && (bIgnoreHidden==0 || IsHiddenColumn(&pSrc->a[i].pTab->aCol[iCol])==0)
143269 sqlite3SrcItemColumnUsed(&pSrc->a[i], iCol);
143386 SrcList *pSrc; /* All tables in the FROM clause */
143391 pSrc = p->pSrc;
143392 pLeft = &pSrc->a[0];
143394 for(i=0; i<pSrc->nSrc-1; i++, pRight++, pLeft++){
143416 if( tableAndColumnIndex(pSrc, 0, i, zName, 0, 0, 1) ){
143456 || tableAndColumnIndex(pSrc, 0, i, zName, &iLeft, &iLeftCol,
143463 pE1 = sqlite3CreateColumnExpr(db, pSrc, iLeft, iLeftCol);
143464 sqlite3SrcItemColumnUsed(&pSrc->a[iLeft], iLeftCol);
143465 if( (pSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){
143481 while( tableAndColumnIndex(pSrc, iLeft+1, i, zName, &iLeft, &iLeftCol,
143483 if( pSrc->a[iLeft].fg.isUsing==0
143484 || sqlite3IdListIndex(pSrc->a[iLeft].u3.pUsing, zName)<0
143491 pE1 = sqlite3CreateColumnExpr(db, pSrc, iLeft, iLeftCol);
143492 sqlite3SrcItemColumnUsed(&pSrc->a[iLeft], iLeftCol);
143499 pE2 = sqlite3CreateColumnExpr(db, pSrc, i+1, iRightCol);
144861 sNC.pSrcList = pS->pSrc;
144907 sNC.pSrcList = pS->pSrc;
145015 pTabList = pSelect->pSrc;
145225 sNC.pSrcList = pSelect->pSrc;
145519 SrcList *pSrc = p->pSrc; /* The FROM clause of the recursive query */
145560 for(i=0; ALWAYS(i<pSrc->nSrc); i++){
145561 if( pSrc->a[i].fg.isRecursive ){
145562 iCurrent = pSrc->a[i].iCursor;
146853 SrcList *pSrc;
146863 pSrc = p->pSrc;
146864 assert( pSrc!=0 );
146865 for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
146924 SrcList *pSrc, /* FROM clause to renumber */
146929 for(i=0, pItem=pSrc->a; i<pSrc->nSrc; i++, pItem++){
146938 srclistRenumberCursors(pParse, aCsrMap, p->pSrc, -1);
146995 srclistRenumberCursors(pParse, aCsrMap, p->pSrc, iExcept);
147228 SrcList *pSrc; /* The FROM clause of the outer query */
147245 pSrc = p->pSrc;
147246 assert( pSrc && iFrom>=0 && iFrom<pSrc->nSrc );
147247 pSubitem = &pSrc->a[iFrom];
147256 pSubSrc = pSub->pSrc;
147270 if( pSub->pLimit && (pSrc->nSrc>1 || isAgg) ){
147335 assert( pSub->pSrc!=0 );
147340 || pSub1->pSrc->nSrc<1 /* (17c) */
147347 if( iFrom>0 && (pSub1->pSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){
147353 testcase( pSub1->pSrc->nSrc>1 );
147369 if( pSrc->nSrc>1 ){
147504 u8 ltorj = pSrc->a[iFrom].fg.jointype & JT_LTORJ;
147506 pSubSrc = pSub->pSrc; /* FROM clause of subquery */
147508 pSrc = pParent->pSrc; /* FROM clause of the outer query */
147530 pSrc = sqlite3SrcListEnlarge(pParse, pSrc, nSubSrc-1,iFrom+1);
147531 if( pSrc==0 ) break;
147532 pParent->pSrc = pSrc;
147539 SrcItem *pItem = &pSrc->a[i+iFrom];
147547 pSrc->a[iFrom].fg.jointype &= JT_LTORJ;
147548 pSrc->a[iFrom].fg.jointype |= jointype | ltorj;
147623 recomputeColumnsUsed(pParent, &pSrc->a[i+iFrom]);
147886 if( ALWAYS(p->pSrc!=0)
147887 && p->pSrc->nSrc>0
147888 && (p->pSrc->a[0].fg.jointype & JT_LTORJ)!=0
148059 SrcItem *pSrc; /* The subquery FROM term into which WHERE is pushed */
148061 pSrc = &pSrcList->a[iSrc];
148066 if( pSrc->fg.jointype & (JT_LTORJ|JT_RIGHT) ){
148178 x.iTable = pSrc->iCursor;
148179 x.iNewTable = pSrc->iCursor;
148355 || p->pSrc->nSrc!=1
148356 || p->pSrc->a[0].pSelect
148362 pTab = p->pSrc->a[0].pTab;
148466 p->pSrc = pNewSrc;
148672 SrcList *pSrc = pRecTerm->pSrc;
148674 for(i=0; i<pSrc->nSrc; i++){
148675 SrcItem *pItem = &pSrc->a[i];
148874 assert( p->pSrc!=0 );
148882 pTabList = p->pSrc;
149306 pTabList = p->pSrc;
150036 if( p->pSrc->nSrc!=1 ) return 0; /* One table in FROM */
150038 pSub = p->pSrc->a[0].pSelect;
150056 pSub = p->pSrc->a[0].pSelect;
150057 p->pSrc->a[0].pSelect = 0;
150058 sqlite3SrcListDelete(db, p->pSrc);
150059 p->pSrc = sqlite3DbMallocZero(pParse->db, sizeof(*p->pSrc));
150097 static int sameSrcAlias(SrcItem *p0, SrcList *pSrc){
150099 for(i=0; i<pSrc->nSrc; i++){
150100 SrcItem *p1 = &pSrc->a[i];
150107 && sameSrcAlias(p0, p1->pSelect->pSrc)
150279 SrcItem *p0 = &p->pSrc->a[0];
150280 if( sameSrcAlias(p0, p->pSrc) ){
150311 pTabList = p->pSrc;
150478 pTabList = p->pSrc;
150527 pTabList = p->pSrc;
151341 if( !p->pSrc->a[0].fg.notIndexed ){
152574 SrcList *pSrc; /* SrcList to be returned */
152576 pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
152577 assert( pSrc==0 || pSrc->nSrc==1 );
152578 assert( zName || pSrc==0 );
152579 if( pSrc ){
152581 pSrc->a[0].zName = zName;
152583 pSrc->a[0].pSchema = pSchema;
152595 pSrc = sqlite3SrcListAppendList(pParse, pSrc, pDup);
152600 return pSrc;
152691 SrcList *pSrc;
152693 pSrc = pSelect->pSrc;
152694 assert( pSrc!=0 );
152695 for(i=0; i<pSrc->nSrc; i++){
152696 if( pSrc->a[i].pTab==pWalker->u.pTab ){
152765 sSelect.pSrc = &sFrom;
153294 SrcList *pSrc, /* The virtual table to be modified */
153479 SrcList *pSrc;
153495 pSrc = sqlite3SrcListDup(db, pTabList, 0);
153499 if( pSrc ){
153500 assert( pSrc->a[0].fg.notCte );
153501 pSrc->a[0].iCursor = -1;
153502 pSrc->a[0].pTab->nTabRef--;
153503 pSrc->a[0].pTab = 0;
153539 pSrc, pWhere2, pGrp, 0, pOrderBy2,
154477 SrcList *pSrc, /* The virtual table to be modified */
154495 int iCsr = pSrc->a[0].iCursor; /* Cursor used for virtual table scan */
154508 if( pSrc->nSrc>1 ){
154544 updateFromSelect(pParse, ephemTab, pPk, pList, pSrc, pWhere, 0, 0);
154553 pParse, pSrc, pWhere, 0, 0, 0, WHERE_ONEPASS_DESIRED, 0
154613 if( pSrc->nSrc==1 ){
154920 SrcList *pSrc; /* FROM clause for the UPDATE */
154961 pSrc = sqlite3SrcListDup(db, pTop->pUpsertSrc, 0);
154968 sqlite3Update(pParse, pSrc, sqlite3ExprListDup(db,pUpsert->pUpsertSet,0),
160754 SrcList *pSrc, /* the FROM clause */
160789 exprAnalyze(pSrc, pWC, idxNew);
160881 SrcList *pSrc, /* the FROM clause */
160911 sqlite3WhereExprAnalyze(pSrc, pOrWc);
160939 sqlite3WhereExprAnalyze(pSrc, pAndWC);
160992 whereCombineDisjuncts(pSrc, pWC, pOne, pTwo);
161128 exprAnalyze(pSrc, pWC, idxNew);
161180 SrcList *pSrc = pS->pSrc;
161186 if( ALWAYS(pSrc!=0) ){
161188 for(i=0; i<pSrc->nSrc; i++){
161189 mask |= exprSelectUsage(pMaskSet, pSrc->a[i].pSelect);
161190 if( pSrc->a[i].fg.isUsing==0 ){
161191 mask |= sqlite3WhereExprUsage(pMaskSet, pSrc->a[i].u3.pOn);
161193 if( pSrc->a[i].fg.isTabFunc ){
161194 mask |= sqlite3WhereExprListUsage(pMaskSet, pSrc->a[i].u1.pFuncArg);
161300 SrcList *pSrc, /* the FROM clause */
161379 if( ALWAYS(pSrc->nSrc>0) && (pSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){
161403 if( exprMightBeIndexed(pSrc, aiCurCol, pLeft, op) ){
161411 && exprMightBeIndexed(pSrc, aiCurCol, pRight, op)
161496 exprAnalyze(pSrc, pWC, idxNew);
161509 exprAnalyzeOrTerm(pSrc, pWC, idxTerm);
161629 exprAnalyze(pSrc, pWC, idxNew1);
161630 exprAnalyze(pSrc, pWC, idxNew2);
161666 exprAnalyze(pSrc, pWC, idxNew);
161697 exprAnalyze(pSrc, pWC, idxNew);
161859 && (p->pSrc->nSrc==1 && IsVirtual(p->pSrc->a[0].pTab)) /* 3 */
161862 int iCsr = p->pSrc->a[0].iCursor;
162308 static void whereOrMove(WhereOrSet *pDest, WhereOrSet *pSrc){
162309 pDest->n = pSrc->n;
162310 memcpy(pDest->a, pSrc->a, pDest->n*sizeof(pDest->a[0]));
162940 const SrcItem *pSrc /* Table we are trying to access */
162942 assert( (pSrc->fg.jointype&(JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 ); /* By caller */
162943 testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_LEFT );
162944 testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_LTORJ );
162948 || pTerm->pExpr->w.iJoin != pSrc->iCursor
162952 if( (pSrc->fg.jointype & (JT_LEFT|JT_RIGHT))!=0
162970 const SrcItem *pSrc, /* Table we are trying to access */
162974 if( pTerm->leftCursor!=pSrc->iCursor ) return 0;
162976 assert( (pSrc->fg.jointype & JT_RIGHT)==0 );
162977 if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0
162978 && !constraintCompatibleWithOuterJoin(pTerm,pSrc)
162985 aff = pSrc->pTab->aCol[pTerm->u.x.leftColumn].affinity;
163078 SrcItem *pSrc; /* The FROM clause term to get the next index */
163095 pSrc = &pTabList->a[pLevel->iFrom];
163096 pTable = pSrc->pTab;
163111 if( termCanDriveIndex(pTerm, pSrc, notReady) ){
163150 extraCols = pSrc->colUsed & (~idxCols | MASKBIT(BMS-1));
163158 if( pSrc->colUsed & MASKBIT(BMS-1) ){
163171 if( termCanDriveIndex(pTerm, pSrc, notReady) ){
163211 if( pSrc->colUsed & MASKBIT(BMS-1) ){
163236 assert( pSrc == &pWC->pWInfo->pTabList->a[pLevel->iFrom] );
163237 if( pSrc->fg.viaCoroutine ){
163238 int regYield = pSrc->regReturn;
163240 sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, pSrc->addrFillSub);
163243 VdbeComment((v, "next row of %s", pSrc->pTab->zName));
163264 if( pSrc->fg.viaCoroutine ){
163269 pSrc->regResult, pLevel->iIdxCur);
163271 pSrc->fg.viaCoroutine = 0;
163438 SrcItem *pSrc, /* The FROM clause term that is the vtab */
163456 assert( pSrc!=0 );
163457 pTab = pSrc->pTab;
163467 if( pTerm->leftCursor != pSrc->iCursor ) continue;
163480 if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0
163481 && !constraintCompatibleWithOuterJoin(pTerm,pSrc)
163509 if( pExpr->op==TK_COLUMN && pExpr->iTable==pSrc->iCursor ){
163518 && pE2->iTable==pSrc->iCursor
163536 if( (pWInfo->wctrlFlags & WHERE_DISTINCTBY) && !pSrc->fg.rowidUsed ){
165104 SrcItem *pSrc, /* FROM clause term being analyzed */
165147 if( pProbe->bLowQual && pSrc->fg.isIndexedBy==0 ){
165164 pTerm = whereScanInit(&scan, pBuilder->pWC, pSrc->iCursor, saved_nEq,
165188 if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0
165189 && !constraintCompatibleWithOuterJoin(pTerm,pSrc)
165302 pParse, pSrc->iCursor, pProbe, saved_nEq, pTerm
165423 assert( pSrc->pTab->szTabRow>0 );
165431 rCostIdx = pNew->nOut + 1 + (15*pProbe->szIdxRow)/pSrc->pTab->szTabRow;
165467 whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nInMul+nIn);
165513 whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter + nInMul);
165883 SrcItem *pSrc; /* The FROM clause btree term to add */
165895 pSrc = pTabList->a + pNew->iTab;
165896 pTab = pSrc->pTab;
165898 assert( !IsVirtual(pSrc->pTab) );
165900 if( pSrc->fg.isIndexedBy ){
165901 assert( pSrc->fg.isCte==0 );
165903 pProbe = pSrc->u2.pIBIndex;
165923 pFirst = pSrc->pTab->pIndex;
165924 if( pSrc->fg.notIndexed==0 ){
165938 && !pSrc->fg.isIndexedBy /* Has no INDEXED BY clause */
165939 && !pSrc->fg.notIndexed /* Has no NOT INDEXED clause */
165941 && !pSrc->fg.isCorrelated /* Not a correlated subquery */
165942 && !pSrc->fg.isRecursive /* Not a recursive common table expression. */
165943 && (pSrc->fg.jointype & JT_RIGHT)==0 /* Not the right tab of a RIGHT JOIN */
165952 if( termCanDriveIndex(pTerm, pSrc, 0) ){
165992 pProbe=(pSrc->fg.isIndexedBy ? 0 : pProbe->pNext), iSortIdx++
165995 && !whereUsablePartialIndex(pSrc->iCursor, pSrc->fg.jointype, pWC,
165998 testcase( pNew->iTab!=pSrc->iCursor ); /* See ticket [98d973b8f5] */
166013 b = indexMightHelpWithOrderBy(pBuilder, pProbe, pSrc->iCursor);
166051 m = pSrc->colUsed & pProbe->colNotIdxed;
166059 u32 isCov = whereIsCoveringIndex(pWInfo, pProbe, pSrc->iCursor);
166093 || pSrc->fg.isIndexedBy
166116 int iCur = pSrc->iCursor;
166137 if( (pSrc->fg.jointype & JT_RIGHT)!=0 && pProbe->aColExpr ){
166151 rc = whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, 0);
166233 SrcItem *pSrc = &pBuilder->pWInfo->pTabList->a[pNew->iTab];
166263 pIdxInfo->colUsed = (sqlite3_int64)pSrc->colUsed;
166267 rc = vtabBestIndex(pParse, pSrc->pTab, pIdxInfo);
166296 sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
166364 sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
166549 SrcItem *pSrc; /* The FROM clause term to search */
166563 pSrc = &pWInfo->pTabList->a[pNew->iTab];
166564 assert( IsVirtual(pSrc->pTab) );
166565 p = allocateIndexInfo(pWInfo, pWC, mUnusable, pSrc, &mNoOmit);
166578 WHERETRACE(0x800, ("BEGIN %s.addVirtual()\n", pSrc->pTab->zName));
166662 WHERETRACE(0x800, ("END %s.addVirtual(), rc=%d\n", pSrc->pTab->zName, rc));
168585 sSelect.pSrc = pTabList;
168936 SrcItem *pSrc;
168940 pSrc = &pTabList->a[pLevel->iFrom];
168941 if( pSrc->fg.isMaterialized ){
168942 if( pSrc->fg.isCorrelated ){
168943 sqlite3VdbeAddOp2(v, OP_Gosub, pSrc->regReturn, pSrc->addrFillSub);
168946 sqlite3VdbeAddOp2(v, OP_Gosub, pSrc->regReturn, pSrc->addrFillSub);
169157 SrcItem *pSrc = &pTabList->a[pLevel->iFrom];
169158 assert( pLevel->iTabCur==pSrc->iCursor );
169159 if( pSrc->fg.viaCoroutine ){
169161 n = pSrc->regResult;
169162 assert( pSrc->pTab!=0 );
169163 m = pSrc->pTab->nCol;
170084 SrcList *pSrc;
170110 int nSrc = p->pSrc->nSrc;
170113 if( pExpr->iTable==p->pSrc->a[i].iCursor ) break;
170208 SrcList *pSrc,
170222 sRewrite.pSrc = pSrc;
170315 SrcList *pSrc = p->pSrc;
170341 p->pSrc = 0;
170369 selectWindowRewriteEList(pParse, pMWin, pSrc, p->pEList, pTab, &pSublist);
170370 selectWindowRewriteEList(pParse, pMWin, pSrc, p->pOrderBy, pTab, &pSublist);
170389 selectWindowRewriteEList(pParse, pMWin, pSrc, pArgs, pTab, &pSublist);
170418 pParse, pSublist, pSrc, pWhere, pGroupBy, pHaving, pSort, 0, 0
170423 p->pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
170424 assert( pSub!=0 || p->pSrc==0 ); /* Due to db->mallocFailed test inside
170427 if( p->pSrc ){
170429 p->pSrc->a[0].pSelect = pSub;
170430 p->pSrc->a[0].fg.isCorrelated = 1;
170431 sqlite3SrcListAssignCursors(pParse, p->pSrc);
170443 p->pSrc->a[0].pTab = pTab;
170739 int nEphExpr = pSelect->pSrc->a[0].pSelect->pEList->nExpr;
172138 int csrInput = p->pSrc->a[0].iCursor; /* Cursor of sub-select */
172139 int nInput = p->pSrc->a[0].pTab->nCol; /* Number of cols returned by sub */
177125 SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
177126 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
177127 …if( yymsp[0].minor.yy14 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy14);
211149 u8 *pSrc = &pDst[pRtree->nBytesPerCell];
211151 memmove(pDst, pSrc, nByte);
212131 RtreeMatchArg *pBlob, *pSrc; /* BLOB returned by geometry function */
212134 pSrc = sqlite3_value_pointer(pValue, "RtreeMatchArg");
212135 if( pSrc==0 ) return SQLITE_ERROR;
212137 sqlite3_malloc64( sizeof(*pInfo)+pSrc->iSize );
212141 memcpy(pBlob, pSrc, pSrc->iSize);