Lines Matching refs:pSrc
10163 SrcList *pSrc; /* The FROM clause */ member
18929 SrcList *pSrc = va_arg(ap, SrcList*); in sqlite3VXPrintf() local
18931 struct SrcList_item *pItem = &pSrc->a[k]; in sqlite3VXPrintf()
18932 assert( k>=0 && k<pSrc->nSrc ); in sqlite3VXPrintf()
50599 const u8 *pSrc;
50637 pSrc = pData;
50645 pSrc = pKey;
50721 assert( pSrc );
50722 memcpy(pPayload, pSrc, n);
50728 pSrc += n;
50733 pSrc = pData;
53540 Btree *pSrc; /* Source b-tree file */
53671 p->pSrc = findBtree(pDestDb, pSrcDb, zSrcDb);
53678 if( 0==p->pSrc || 0==p->pDest ){
53688 p->pSrc->nBackup++;
53712 const int nSrcPgsz = sqlite3BtreeGetPageSize(p->pSrc);
53722 assert( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) );
53795 assert( sqlite3BtreeHoldsMutex(p->pSrc) );
53796 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
53812 sqlite3BtreeEnter(p->pSrc);
53819 Pager * const pSrcPager = sqlite3BtreePager(p->pSrc); /* Source pager */
53828 if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){
53846 if( rc==SQLITE_OK && 0==sqlite3BtreeIsInReadTrans(p->pSrc) ){
53847 rc = sqlite3BtreeBeginTrans(p->pSrc, 0);
53853 pgszSrc = sqlite3BtreeGetPageSize(p->pSrc);
53863 nSrcPage = (int)sqlite3BtreeLastPage(p->pSrc);
53867 if( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ){
53913 assert( pgszSrc==sqlite3BtreeGetPageSize(p->pSrc) );
53984 TESTONLY( rc2 = ) sqlite3BtreeCommitPhaseOne(p->pSrc, 0);
53985 TESTONLY( rc2 |= ) sqlite3BtreeCommitPhaseTwo(p->pSrc);
53997 sqlite3BtreeLeave(p->pSrc);
54013 sqlite3BtreeEnter(p->pSrc);
54021 p->pSrc->nBackup--;
54024 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
54042 sqlite3BtreeLeave(p->pSrc);
54084 assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
54113 assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
54140 b.pSrc = pFrom;
67563 SrcList *pSrc;
67567 pSrc = p->pSrc;
67568 if( ALWAYS(pSrc) ){
67569 for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
68010 SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){
68013 struct SrcList_item *pItem = &pSrc->a[iSrc];
68282 nc.pSrcList = pSelect->pSrc;
68582 sNC.pSrcList = p->pSrc;
68597 for(i=0; i<p->pSrc->nSrc; i++){
68598 struct SrcList_item *pItem = &p->pSrc->a[i];
69749 pNew->pSrc = sqlite3SrcListDup(db, p->pSrc, flags);
70154 SrcList *pSrc;
70168 pSrc = p->pSrc;
70169 assert( pSrc!=0 );
70170 if( pSrc->nSrc!=1 ) return 0; /* Single term in FROM clause */
70171 if( pSrc->a[0].pSelect ) return 0; /* FROM is not a subquery or view */
70172 pTab = pSrc->a[0].pTab;
70256 Table *pTab = p->pSrc->a[0].pTab; /* Table <table>. */
72941 SrcList *pSrc, /* The table to rename. */
72960 assert( pSrc->nSrc==1 );
72963 pTab = sqlite3LocateTable(pParse, 0, pSrc->a[0].zName, pSrc->a[0].zDatabase);
73133 sqlite3SrcListDelete(db, pSrc);
73296 SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
73309 pTab = sqlite3LocateTable(pParse, 0, pSrc->a[0].zName, pSrc->a[0].zDatabase);
73369 sqlite3SrcListDelete(db, pSrc);
74538 if( sqlite3FixSrcList(pFix, pSelect->pSrc) ){
76620 sqlite3SrcListAssignCursors(pParse, pSel->pSrc);
77901 SrcList *pSrc, /* The SrcList to be enlarged */
77910 assert( pSrc!=0 );
77911 assert( iStart<=pSrc->nSrc );
77914 if( pSrc->nSrc+nExtra>pSrc->nAlloc ){
77916 int nAlloc = pSrc->nSrc+nExtra;
77918 pNew = sqlite3DbRealloc(db, pSrc,
77919 sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) );
77922 return pSrc;
77924 pSrc = pNew;
77925 nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1;
77926 pSrc->nAlloc = (u16)nGot;
77931 for(i=pSrc->nSrc-1; i>=iStart; i--){
77932 pSrc->a[i+nExtra] = pSrc->a[i];
77934 pSrc->nSrc += (i16)nExtra;
77937 memset(&pSrc->a[iStart], 0, sizeof(pSrc->a[0])*nExtra);
77939 pSrc->a[i].iCursor = -1;
77943 return pSrc;
78025 sqlite3SrcListAssignCursors(pParse, pItem->pSelect->pSrc);
79027 SQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){
79028 struct SrcList_item *pItem = pSrc->a;
79030 assert( pItem && pSrc->nSrc==1 );
79129 SrcList *pSrc, /* the FROM clause -- which tables to scan */
79176 pSelectSrc = sqlite3SrcListDup(pParse->db, pSrc, 0);
81695 SrcList *pSrc, /* SrcList containing the table to scan */
81770 pRight->iTable = pSrc->a[0].iCursor;
81779 sNameContext.pSrcList = pSrc;
81787 pWInfo = sqlite3WhereBegin(pParse, pSrc, pWhere, 0, 0);
82015 SrcList *pSrc;
82034 pSrc = sqlite3SrcListAppend(db, 0, 0, 0);
82035 if( pSrc ){
82036 struct SrcList_item *pItem = pSrc->a;
82043 fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regNew, -1);
82052 fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regOld, 1);
82055 sqlite3SrcListDelete(db, pSrc);
83977 static int xferCompatibleIndex(Index *pDest, Index *pSrc){
83979 assert( pDest && pSrc );
83980 assert( pDest->pTable!=pSrc->pTable );
83981 if( pDest->nColumn!=pSrc->nColumn ){
83984 if( pDest->onError!=pSrc->onError ){
83987 for(i=0; i<pSrc->nColumn; i++){
83988 if( pSrc->aiColumn[i]!=pDest->aiColumn[i] ){
83991 if( pSrc->aSortOrder[i]!=pDest->aSortOrder[i] ){
83994 if( !xferCompatibleCollation(pSrc->azColl[i],pDest->azColl[i]) ){
84042 Table *pSrc; /* The table in the FROM clause of SELECT */
84074 assert(pSelect->pSrc); /* allocated even if there is no FROM clause */
84075 if( pSelect->pSrc->nSrc!=1 ){
84078 if( pSelect->pSrc->a[0].pSelect ){
84116 pItem = pSelect->pSrc->a;
84117 pSrc = sqlite3LocateTable(pParse, 0, pItem->zName, pItem->zDatabase);
84118 if( pSrc==0 ){
84121 if( pSrc==pDest ){
84125 if( pSrc->tabFlags & TF_Virtual ){
84129 if( pSrc->pSelect ){
84132 if( pDest->nCol!=pSrc->nCol ){
84135 if( pDest->iPKey!=pSrc->iPKey ){
84139 if( pDest->aCol[i].affinity!=pSrc->aCol[i].affinity ){
84142 if( !xferCompatibleCollation(pDest->aCol[i].zColl, pSrc->aCol[i].zColl) ){
84145 if( pDest->aCol[i].notNull && !pSrc->aCol[i].notNull ){
84153 for(pSrcIdx=pSrc->pIndex; pSrcIdx; pSrcIdx=pSrcIdx->pNext){
84161 if( pDest->pCheck && sqlite3ExprCompare(pSrc->pCheck, pDest->pCheck) ){
84177 iDbSrc = sqlite3SchemaToIndex(pParse->db, pSrc->pSchema);
84201 sqlite3OpenTable(pParse, iSrc, iDbSrc, pSrc, OP_OpenRead);
84224 for(pSrcIdx=pSrc->pIndex; ALWAYS(pSrcIdx); pSrcIdx=pSrcIdx->pNext){
87871 sqlite3SrcListDelete(db, p->pSrc);
87900 SrcList *pSrc, /* the FROM clause -- which tables to scan */
87922 pNew->pSrc = pSrc;
88049 SrcList *pSrc, /* Array of tables to search */
88060 iCol = columnIndex(pSrc->a[i].pTab, zCol);
88085 SrcList *pSrc, /* List of tables in FROM clause */
88099 assert( pSrc->nSrc>iRight );
88100 assert( pSrc->a[iLeft].pTab );
88101 assert( pSrc->a[iRight].pTab );
88103 pE1 = sqlite3CreateColumnExpr(db, pSrc, iLeft, iColLeft);
88104 pE2 = sqlite3CreateColumnExpr(db, pSrc, iRight, iColRight);
88168 SrcList *pSrc; /* All tables in the FROM clause */
88173 pSrc = p->pSrc;
88174 pLeft = &pSrc->a[0];
88176 for(i=0; i<pSrc->nSrc-1; i++, pRight++, pLeft++){
88199 if( tableAndColumnIndex(pSrc, i+1, zName, &iLeft, &iLeftCol) ){
88200 addWhereTerm(pParse, pSrc, iLeft, iLeftCol, i+1, j,
88241 || !tableAndColumnIndex(pSrc, i+1, zName, &iLeft, &iLeftCol)
88247 addWhereTerm(pParse, pSrc, iLeft, iLeftCol, i+1, iRightCol,
88890 sNC.pSrcList = pS->pSrc;
88925 sNC.pSrcList = pS->pSrc;
89173 sNC.pSrcList = pSelect->pSrc;
90384 SrcList *pSrc;
90394 pSrc = p->pSrc;
90395 assert( pSrc ); /* Even for (SELECT 1) we have: pSrc!=0 but pSrc->nSrc==0 */
90396 if( ALWAYS(pSrc) ){
90397 for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
90523 SrcList *pSrc; /* The FROM clause of the outer query */
90537 pSrc = p->pSrc;
90538 assert( pSrc && iFrom>=0 && iFrom<pSrc->nSrc );
90539 pSubitem = &pSrc->a[iFrom];
90544 if( subqueryIsAgg && pSrc->nSrc>1 ) return 0; /* Restriction (2) */
90545 pSubSrc = pSub->pSrc;
90559 if( pSub->pLimit && (pSrc->nSrc>1 || isAgg) ){
90616 if( isAgg || (p->selFlags & SF_Distinct)!=0 || pSrc->nSrc!=1 ){
90624 || NEVER(pSub1->pSrc==0) || pSub1->pSrc->nSrc!=1
90685 p->pSrc = 0;
90691 p->pSrc = pSrc;
90755 pSubSrc = pSub->pSrc; /* FROM clause of subquery */
90757 pSrc = pParent->pSrc; /* FROM clause of the outer query */
90759 if( pSrc ){
90764 pSrc = pParent->pSrc = sqlite3SrcListAppend(db, 0, 0, 0);
90765 if( pSrc==0 ){
90787 pParent->pSrc = pSrc = sqlite3SrcListEnlarge(db, pSrc, nSubSrc-1,iFrom+1);
90797 sqlite3IdListDelete(db, pSrc->a[i+iFrom].pUsing);
90798 pSrc->a[i+iFrom] = pSubSrc->a[i];
90801 pSrc->a[iFrom].jointype = jointype;
90930 || p->pSrc->nSrc!=1 || p->pSrc->a[0].pSelect
90934 pTab = p->pSrc->a[0].pTab;
91007 if( NEVER(p->pSrc==0) || (p->selFlags & SF_Expanded)!=0 ){
91011 pTabList = p->pSrc;
91275 pTabList = p->pSrc;
91562 pTabList = p->pSrc;
91624 pTabList = p->pSrc;
92225 if( p->pSrc ){
92229 for(i=0; i<p->pSrc->nSrc; i++){
92230 struct SrcList_item *pItem = &p->pSrc->a[i];
92246 if( i<p->pSrc->nSrc-1 ){
93130 SrcList *pSrc; /* SrcList to be returned */
93132 pSrc = sqlite3SrcListAppend(pParse->db, 0, &pStep->target, 0);
93133 if( pSrc ){
93134 assert( pSrc->nSrc>0 );
93135 assert( pSrc->a!=0 );
93140 pSrc->a[pSrc->nSrc-1].zDatabase = sqlite3DbStrDup(db, db->aDb[iDb].zName);
93143 return pSrc;
93592 SrcList *pSrc, /* The virtual table to be modified */
94168 SrcList *pSrc, /* The virtual table to be modified */
94204 pSelect = sqlite3SelectNew(pParse, pEList, pSrc, pWhere, 0, 0, 0, 0, 0, 0);
96362 SrcList *pSrc, /* the FROM clause */
96391 exprAnalyzeAll(pSrc, pOrWc);
96418 exprAnalyzeAll(pSrc, pAndWC);
96581 exprAnalyze(pSrc, pWC, idxNew);
96614 SrcList *pSrc, /* the FROM clause */
96732 exprAnalyze(pSrc, pWC, idxNew);
96746 exprAnalyzeOrTerm(pSrc, pWC, idxTerm);
96799 exprAnalyze(pSrc, pWC, idxNew1);
96805 exprAnalyze(pSrc, pWC, idxNew2);
97097 struct SrcList_item *pSrc, /* The FROM clause term to search */
97104 const int iCur = pSrc->iCursor; /* The cursor of the table to be accessed */
97111 if( pSrc->notIndexed || pSrc->pIndex!=0 ){
97136 bestIndex(pParse, pAndWC, pSrc, notReady, notValid, 0, &sTermCost);
97144 bestIndex(pParse, &tempWC, pSrc, notReady, notValid, 0, &sTermCost);
97186 struct SrcList_item *pSrc, /* Table we are trying to access */
97190 if( pTerm->leftCursor!=pSrc->iCursor ) return 0;
97193 aff = pSrc->pTab->aCol[pTerm->u.leftColumn].affinity;
97211 struct SrcList_item *pSrc, /* The FROM clause term to search */
97230 if( pSrc->notIndexed ){
97236 pTable = pSrc->pTab;
97249 if( termCanDriveIndex(pTerm, pSrc, notReady) ){
97274 struct SrcList_item *pSrc, /* The FROM clause term to get the next index */
97308 pTable = pSrc->pTab;
97312 if( termCanDriveIndex(pTerm, pSrc, notReady) ){
97334 extraCols = pSrc->colUsed & (~idxCols | (((Bitmask)1)<<(BMS-1)));
97341 if( pSrc->colUsed & (((Bitmask)1)<<(BMS-1)) ){
97363 if( termCanDriveIndex(pTerm, pSrc, notReady) ){
97387 if( pSrc->colUsed & (((Bitmask)1)<<(BMS-1)) ){
97428 struct SrcList_item *pSrc,
97440 WHERETRACE(("Recomputing index info for %s...\n", pSrc->pTab->zName));
97445 if( pTerm->leftCursor != pSrc->iCursor ) continue;
97461 if( pExpr->op!=TK_COLUMN || pExpr->iTable!=pSrc->iCursor ) break;
97495 if( pTerm->leftCursor != pSrc->iCursor ) continue;
97590 struct SrcList_item *pSrc, /* The FROM clause term to search */
97597 Table *pTab = pSrc->pTab;
97618 *ppIdxInfo = pIdxInfo = allocateIndexInfo(pParse, pWC, pSrc, pOrderBy);
97722 bestOrClauseIndex(pParse, pWC, pSrc, notReady, notValid, pOrderBy, pCost);
98001 struct SrcList_item *pSrc, /* The FROM clause term to search */
98007 int iCur = pSrc->iCursor; /* The cursor of the table to be accessed */
98026 if( pSrc->jointype & JT_LEFT ){
98032 if( pSrc->pIndex ){
98034 pIdx = pProbe = pSrc->pIndex;
98046 sPk.pTable = pSrc->pTab;
98047 aiRowEstPk[0] = pSrc->pTab->nRowEst;
98049 pFirst = pSrc->pTab->pIndex;
98050 if( pSrc->notIndexed==0 ){
98206 Bitmask m = pSrc->colUsed;
98316 pSrc->pTab->zName, (pIdx ? pIdx->zName : "ipk"),
98337 if( pSrc->pIndex ) break;
98355 assert( pSrc->pIndex==0
98357 || pCost->plan.u.pIdx==pSrc->pIndex
98365 bestOrClauseIndex(pParse, pWC, pSrc, notReady, notValid, pOrderBy, pCost);
98366 bestAutomaticIndex(pParse, pWC, pSrc, notReady, pCost);
98379 struct SrcList_item *pSrc, /* The FROM clause term to search */
98386 if( IsVirtual(pSrc->pTab) ){
98388 bestVirtualIndex(pParse, pWC, pSrc, notReady, notValid, pOrderBy, pCost,&p);
98396 bestBtreeIndex(pParse, pWC, pSrc, notReady, notValid, pOrderBy, pCost);
103046 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
103049 yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
103053 sqlite3SrcListDelete(pParse->db, pSrc);
119688 u8 *pSrc = &pDst[pRtree->nBytesPerCell];
119690 memmove(pDst, pSrc, nByte);