Lines Matching refs:pSrc

15252   SrcList *pSrc;         /* The FROM clause */  member
25372 SrcList *pSrc = va_arg(ap, SrcList*);
25374 struct SrcList_item *pItem = &pSrc->a[k];
25376 assert( k>=0 && k<pSrc->nSrc );
25899 if( p->pSrc && p->pSrc->nSrc ) n++;
25908 if( p->pSrc && p->pSrc->nSrc ){
25912 for(i=0; i<p->pSrc->nSrc; i++){
25913 struct SrcList_item *pItem = &p->pSrc->a[i];
25933 sqlite3TreeViewItem(pView, zLine, i<p->pSrc->nSrc-1);
48442 SQLITE_PRIVATE void sqlite3PagerAlignReserve(Pager *pDest, Pager *pSrc){
48443 if( pDest->nReserve!=pSrc->nReserve ){
48444 pDest->nReserve = pSrc->nReserve;
64208 const u8 *pSrc;
64230 pSrc = pX->pData;
64240 pSrc = pX->pKey;
64357 assert( pSrc );
64358 memcpy(pPayload, pSrc, n);
64364 pSrc += n;
67880 Btree *pSrc; /* Source b-tree file */
67972 rc = sqlite3BtreeSetPageSize(p->pDest,sqlite3BtreeGetPageSize(p->pSrc),-1,0);
68042 p->pSrc = findBtree(pDestDb, pSrcDb, zSrcDb);
68049 if( 0==p->pSrc || 0==p->pDest
68063 p->pSrc->nBackup++;
68092 const int nSrcPgsz = sqlite3BtreeGetPageSize(p->pSrc);
68100 int nSrcReserve = sqlite3BtreeGetReserveNoMutex(p->pSrc);
68106 assert( sqlite3BtreeGetReserveNoMutex(p->pSrc)>=0 );
68109 assert( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) );
68164 sqlite3Put4byte(&zOut[28], sqlite3BtreeLastPage(p->pSrc));
68196 assert( sqlite3BtreeHoldsMutex(p->pSrc) );
68197 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
68216 sqlite3BtreeEnter(p->pSrc);
68223 Pager * const pSrcPager = sqlite3BtreePager(p->pSrc); /* Source pager */
68232 if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){
68250 if( rc==SQLITE_OK && 0==sqlite3BtreeIsInReadTrans(p->pSrc) ){
68251 rc = sqlite3BtreeBeginTrans(p->pSrc, 0);
68257 pgszSrc = sqlite3BtreeGetPageSize(p->pSrc);
68267 nSrcPage = (int)sqlite3BtreeLastPage(p->pSrc);
68271 if( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ){
68326 assert( pgszSrc==sqlite3BtreeGetPageSize(p->pSrc) );
68429 TESTONLY( rc2 = ) sqlite3BtreeCommitPhaseOne(p->pSrc, 0);
68430 TESTONLY( rc2 |= ) sqlite3BtreeCommitPhaseTwo(p->pSrc, 0);
68442 sqlite3BtreeLeave(p->pSrc);
68459 sqlite3BtreeEnter(p->pSrc);
68466 p->pSrc->nBackup--;
68469 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
68487 sqlite3BtreeLeave(p->pSrc);
68545 assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
68581 assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
68618 b.pSrc = pFrom;
87901 SrcList *pSrc;
87905 pSrc = p->pSrc;
87906 if( ALWAYS(pSrc) ){
87907 for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
88467 SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){
88470 struct SrcList_item *pItem = &pSrc->a[iSrc];
88818 nc.pSrcList = pSelect->pSrc;
89137 Select *pSub = p->pSrc->a[0].pSelect;
89138 assert( p->pSrc->nSrc==1 && p->pOrderBy );
89146 for(i=0; i<p->pSrc->nSrc; i++){
89147 struct SrcList_item *pItem = &p->pSrc->a[i];
89175 sNC.pSrcList = p->pSrc;
89213 for(i=0; i<p->pSrc->nSrc; i++){
89214 struct SrcList_item *pItem = &p->pSrc->a[i];
89234 Select *pSub = p->pSrc->a[0].pSelect;
90588 pNew->pSrc = sqlite3SrcListDup(db, p->pSrc, flags);
91069 SrcList *pSrc;
91086 pSrc = p->pSrc;
91087 assert( pSrc!=0 );
91088 if( pSrc->nSrc!=1 ) return 0; /* Single term in FROM clause */
91089 if( pSrc->a[0].pSelect ) return 0; /* FROM is not a subquery or view */
91090 pTab = pSrc->a[0].pTab;
91098 assert( pRes->iTable==pSrc->a[0].iCursor ); /* Not a correlated subquery */
91240 assert( p->pSrc!=0 ); /* Because of isCandidateForInOpt(p) */
91241 pTab = p->pSrc->a[0].pTab;
93504 SrcList *pSrc; /* One particular FROM clause in a nested query */
93521 SrcList *pSrc = p->pSrc;
93522 int nSrc = pSrc ? pSrc->nSrc : 0;
93524 if( pExpr->iTable==pSrc->a[i].iCursor ) break;
93548 cnt.pSrc = pSrcList;
94238 SrcList *pSrc, /* The table to rename. */
94257 assert( pSrc->nSrc==1 );
94260 pTab = sqlite3LocateTableItem(pParse, 0, &pSrc->a[0]);
94427 sqlite3SrcListDelete(db, pSrc);
94578 SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
94591 pTab = sqlite3LocateTableItem(pParse, 0, &pSrc->a[0]);
94652 sqlite3SrcListDelete(db, pSrc);
97043 if( sqlite3FixSrcList(pFix, pSelect->pSrc) ){
99588 sqlite3SrcListAssignCursors(pParse, pSel->pSrc);
101044 SrcList *pSrc, /* The SrcList to be enlarged */
101053 assert( pSrc!=0 );
101054 assert( iStart<=pSrc->nSrc );
101057 if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){
101059 int nAlloc = pSrc->nSrc+nExtra;
101061 pNew = sqlite3DbRealloc(db, pSrc,
101062 sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) );
101065 return pSrc;
101067 pSrc = pNew;
101068 nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1;
101069 pSrc->nAlloc = nGot;
101074 for(i=pSrc->nSrc-1; i>=iStart; i--){
101075 pSrc->a[i+nExtra] = pSrc->a[i];
101077 pSrc->nSrc += nExtra;
101080 memset(&pSrc->a[iStart], 0, sizeof(pSrc->a[0])*nExtra);
101082 pSrc->a[i].iCursor = -1;
101086 return pSrc;
101170 sqlite3SrcListAssignCursors(pParse, pItem->pSelect->pSrc);
102348 SQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){
102349 struct SrcList_item *pItem = pSrc->a;
102351 assert( pItem && pSrc->nSrc==1 );
102445 SrcList *pSrc, /* the FROM clause -- which tables to scan */
102491 pSelectSrc = sqlite3SrcListDup(pParse->db, pSrc, 0);
105607 SrcList *pSrc, /* The child table to be scanned */
105675 pRight = exprTableColumn(db, pTab, pSrc->a[0].iCursor, -1);
105685 pRight = exprTableColumn(db, pTab, pSrc->a[0].iCursor, iCol);
105696 sNameContext.pSrcList = pSrc;
105703 pWInfo = sqlite3WhereBegin(pParse, pSrc, pWhere, 0, 0, 0, 0);
106048 SrcList *pSrc;
106072 pSrc = sqlite3SrcListAppend(db, 0, 0, 0);
106073 if( pSrc ){
106074 struct SrcList_item *pItem = pSrc->a;
106081 fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regNew, -1);
106085 fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regOld, 1);
106108 sqlite3SrcListDelete(db, pSrc);
108297 static int xferCompatibleIndex(Index *pDest, Index *pSrc){
108299 assert( pDest && pSrc );
108300 assert( pDest->pTable!=pSrc->pTable );
108301 if( pDest->nKeyCol!=pSrc->nKeyCol ){
108304 if( pDest->onError!=pSrc->onError ){
108307 for(i=0; i<pSrc->nKeyCol; i++){
108308 if( pSrc->aiColumn[i]!=pDest->aiColumn[i] ){
108311 if( pSrc->aiColumn[i]==XN_EXPR ){
108312 assert( pSrc->aColExpr!=0 && pDest->aColExpr!=0 );
108313 if( sqlite3ExprCompare(pSrc->aColExpr->a[i].pExpr,
108318 if( pSrc->aSortOrder[i]!=pDest->aSortOrder[i] ){
108321 if( sqlite3_stricmp(pSrc->azColl[i],pDest->azColl[i])!=0 ){
108325 if( sqlite3ExprCompare(pSrc->pPartIdxWhere, pDest->pPartIdxWhere, -1) ){
108367 Table *pSrc; /* The table in the FROM clause of SELECT */
108402 assert(pSelect->pSrc); /* allocated even if there is no FROM clause */
108403 if( pSelect->pSrc->nSrc!=1 ){
108406 if( pSelect->pSrc->a[0].pSelect ){
108444 pItem = pSelect->pSrc->a;
108445 pSrc = sqlite3LocateTableItem(pParse, 0, pItem);
108446 if( pSrc==0 ){
108449 if( pSrc==pDest ){
108452 if( HasRowid(pDest)!=HasRowid(pSrc) ){
108456 if( pSrc->tabFlags & TF_Virtual ){
108460 if( pSrc->pSelect ){
108463 if( pDest->nCol!=pSrc->nCol ){
108466 if( pDest->iPKey!=pSrc->iPKey ){
108471 Column *pSrcCol = &pSrc->aCol[i];
108504 for(pSrcIdx=pSrc->pIndex; pSrcIdx; pSrcIdx=pSrcIdx->pNext){
108512 if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){
108539 iDbSrc = sqlite3SchemaToIndex(db, pSrc->pSchema);
108575 if( HasRowid(pSrc) ){
108576 sqlite3OpenTable(pParse, iSrc, iDbSrc, pSrc, OP_OpenRead);
108600 sqlite3TableLock(pParse, iDbSrc, pSrc->tnum, 0, pSrc->zName);
108604 for(pSrcIdx=pSrc->pIndex; ALWAYS(pSrcIdx); pSrcIdx=pSrcIdx->pNext){
108643 if( !HasRowid(pSrc) && pDestIdx->idxType==2 ){
113568 sqlite3SrcListDelete(db, p->pSrc);
113601 SrcList *pSrc, /* the FROM clause -- which tables to scan */
113632 if( pSrc==0 ) pSrc = sqlite3DbMallocZero(db, sizeof(*pSrc));
113633 pNew->pSrc = pSrc;
113648 assert( pNew->pSrc!=0 || pParse->nErr>0 );
113777 SrcList *pSrc, /* Array of tables to search */
113788 iCol = columnIndex(pSrc->a[i].pTab, zCol);
113813 SrcList *pSrc, /* List of tables in FROM clause */
113827 assert( pSrc->nSrc>iRight );
113828 assert( pSrc->a[iLeft].pTab );
113829 assert( pSrc->a[iRight].pTab );
113831 pE1 = sqlite3CreateColumnExpr(db, pSrc, iLeft, iColLeft);
113832 pE2 = sqlite3CreateColumnExpr(db, pSrc, iRight, iColRight);
113902 SrcList *pSrc; /* All tables in the FROM clause */
113907 pSrc = p->pSrc;
113908 pLeft = &pSrc->a[0];
113910 for(i=0; i<pSrc->nSrc-1; i++, pRight++, pLeft++){
113933 if( tableAndColumnIndex(pSrc, i+1, zName, &iLeft, &iLeftCol) ){
113934 addWhereTerm(pParse, pSrc, iLeft, iLeftCol, i+1, j,
113975 || !tableAndColumnIndex(pSrc, i+1, zName, &iLeft, &iLeftCol)
113981 addWhereTerm(pParse, pSrc, iLeft, iLeftCol, i+1, iRightCol,
114936 sNC.pSrcList = pS->pSrc;
114981 sNC.pSrcList = pS->pSrc;
115245 sNC.pSrcList = pSelect->pSrc;
115502 SrcList *pSrc = p->pSrc; /* The FROM clause of the recursive query */
115535 for(i=0; ALWAYS(i<pSrc->nSrc); i++){
115536 if( pSrc->a[i].fg.isRecursive ){
115537 iCurrent = pSrc->a[i].iCursor;
115912 generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList);
115987 generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList);
116603 generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList);
116687 SrcList *pSrc;
116697 pSrc = p->pSrc;
116698 assert( pSrc!=0 );
116699 for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
116860 SrcList *pSrc; /* The FROM clause of the outer query */
116874 pSrc = p->pSrc;
116875 assert( pSrc && iFrom>=0 && iFrom<pSrc->nSrc );
116876 pSubitem = &pSrc->a[iFrom];
116882 if( pSrc->nSrc>1 ) return 0; /* Restriction (2a) */
116891 pSubSrc = pSub->pSrc;
116905 if( pSub->pLimit && (pSrc->nSrc>1 || isAgg) ){
116973 if( isAgg || (p->selFlags & SF_Distinct)!=0 || pSrc->nSrc!=1 ){
116979 assert( pSub->pSrc!=0 );
116983 || pSub1->pSrc->nSrc<1
116987 testcase( pSub1->pSrc->nSrc>1 );
117049 p->pSrc = 0;
117058 p->pSrc = pSrc;
117125 pSubSrc = pSub->pSrc; /* FROM clause of subquery */
117127 pSrc = pParent->pSrc; /* FROM clause of the outer query */
117129 if( pSrc ){
117134 pSrc = pParent->pSrc = sqlite3SrcListAppend(db, 0, 0, 0);
117135 if( pSrc==0 ){
117157 pParent->pSrc = pSrc = sqlite3SrcListEnlarge(db, pSrc, nSubSrc-1,iFrom+1);
117167 sqlite3IdListDelete(db, pSrc->a[i+iFrom].pUsing);
117168 assert( pSrc->a[i+iFrom].fg.isTabFunc==0 );
117169 pSrc->a[i+iFrom] = pSubSrc->a[i];
117172 pSrc->a[iFrom].fg.jointype = jointype;
117396 || p->pSrc->nSrc!=1 || p->pSrc->a[0].pSelect
117400 pTab = p->pSrc->a[0].pTab;
117489 p->pSrc = pNewSrc;
117636 SrcList *pSrc = pFrom->pSelect->pSrc;
117637 for(i=0; i<pSrc->nSrc; i++){
117638 struct SrcList_item *pItem = &pSrc->a[i];
117755 if( NEVER(p->pSrc==0) || (selFlags & SF_Expanded)!=0 ){
117758 pTabList = p->pSrc;
118079 pTabList = p->pSrc;
118384 pTabList = p->pSrc;
118434 pTabList = p->pSrc;
120067 SrcList *pSrc; /* SrcList to be returned */
120069 pSrc = sqlite3SrcListAppend(db, 0, 0, 0);
120070 if( pSrc ){
120071 assert( pSrc->nSrc>0 );
120072 pSrc->a[pSrc->nSrc-1].zName = sqlite3DbStrDup(db, pStep->zTarget);
120076 pSrc->a[pSrc->nSrc-1].zDatabase = sqlite3DbStrDup(db, db->aDb[iDb].zName);
120079 return pSrc;
120532 SrcList *pSrc, /* The virtual table to be modified */
121241 SrcList *pSrc, /* The virtual table to be modified */
121259 int iCsr = pSrc->a[0].iCursor; /* Cursor used for virtual table scan */
121276 pWInfo = sqlite3WhereBegin(pParse, pSrc, pWhere, 0,0,WHERE_ONEPASS_DESIRED,0);
125740 SrcList *pSrc, /* the FROM clause */
125774 exprAnalyze(pSrc, pWC, idxNew);
125866 SrcList *pSrc, /* the FROM clause */
125896 sqlite3WhereExprAnalyze(pSrc, pOrWc);
125923 sqlite3WhereExprAnalyze(pSrc, pAndWC);
125972 whereCombineDisjuncts(pSrc, pWC, pOne, pTwo);
126101 exprAnalyze(pSrc, pWC, idxNew);
126159 SrcList *pSrc = pS->pSrc;
126165 if( ALWAYS(pSrc!=0) ){
126167 for(i=0; i<pSrc->nSrc; i++){
126168 mask |= exprSelectUsage(pMaskSet, pSrc->a[i].pSelect);
126169 mask |= sqlite3WhereExprUsage(pMaskSet, pSrc->a[i].pOn);
126241 SrcList *pSrc, /* the FROM clause */
126297 if( exprMightBeIndexed(pSrc, prereqLeft, pLeft, &iCur, &iColumn) ){
126304 && exprMightBeIndexed(pSrc, pTerm->prereqRight, pRight, &iCur, &iColumn)
126373 exprAnalyze(pSrc, pWC, idxNew);
126386 exprAnalyzeOrTerm(pSrc, pWC, idxTerm);
126458 exprAnalyze(pSrc, pWC, idxNew1);
126466 exprAnalyze(pSrc, pWC, idxNew2);
126836 static void whereOrMove(WhereOrSet *pDest, WhereOrSet *pSrc){
126837 pDest->n = pSrc->n;
126838 memcpy(pDest->a, pSrc->a, pDest->n*sizeof(pDest->a[0]));
127318 struct SrcList_item *pSrc, /* Table we are trying to access */
127322 if( pTerm->leftCursor!=pSrc->iCursor ) return 0;
127326 aff = pSrc->pTab->aCol[pTerm->u.leftColumn].affinity;
127343 struct SrcList_item *pSrc, /* The FROM clause term to get the next index */
127380 pTable = pSrc->pTab;
127387 || pExpr->iRightJoinTable!=pSrc->iCursor /* for the right-hand */
127392 && sqlite3ExprIsTableConstant(pExpr, pSrc->iCursor) ){
127396 if( termCanDriveIndex(pTerm, pSrc, notReady) ){
127429 extraCols = pSrc->colUsed & (~idxCols | MASKBIT(BMS-1));
127436 if( pSrc->colUsed & MASKBIT(BMS-1) ){
127449 if( termCanDriveIndex(pTerm, pSrc, notReady) ){
127475 if( pSrc->colUsed & MASKBIT(BMS-1) ){
127549 struct SrcList_item *pSrc,
127564 if( pTerm->leftCursor != pSrc->iCursor ) continue;
127586 if( pExpr->op!=TK_COLUMN || pExpr->iTable!=pSrc->iCursor ) break;
127620 if( pTerm->leftCursor != pSrc->iCursor ) continue;
128935 struct SrcList_item *pSrc, /* FROM clause term being analyzed */
128977 pTerm = whereScanInit(&scan, pBuilder->pWC, pSrc->iCursor, saved_nEq,
129004 if( (pSrc->fg.jointype & JT_LEFT)!=0
129144 rCostIdx = pNew->nOut + 1 + (15*pProbe->szIdxRow)/pSrc->pTab->szTabRow;
129166 whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nInMul+nIn);
129207 whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter + nInMul);
129340 struct SrcList_item *pSrc; /* The FROM clause btree term to add */
129353 pSrc = pTabList->a + pNew->iTab;
129354 pTab = pSrc->pTab;
129356 assert( !IsVirtual(pSrc->pTab) );
129358 if( pSrc->pIBIndex ){
129360 pProbe = pSrc->pIBIndex;
129379 pFirst = pSrc->pTab->pIndex;
129380 if( pSrc->fg.notIndexed==0 ){
129395 && pSrc->pIBIndex==0 /* Has no INDEXED BY clause */
129396 && !pSrc->fg.notIndexed /* Has no NOT INDEXED clause */
129398 && !pSrc->fg.isCorrelated /* Not a correlated subquery */
129399 && !pSrc->fg.isRecursive /* Not a recursive common table expression. */
129406 if( termCanDriveIndex(pTerm, pSrc, 0) ){
129444 && !whereUsablePartialIndex(pSrc->iCursor, pWC, pProbe->pPartIdxWhere) ){
129445 testcase( pNew->iTab!=pSrc->iCursor ); /* See ticket [98d973b8f5] */
129457 b = indexMightHelpWithOrderBy(pBuilder, pProbe, pSrc->iCursor);
129479 m = pSrc->colUsed & ~columnsInIndex(pProbe);
129509 int iCur = pSrc->iCursor;
129536 rc = whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, 0);
129545 if( pSrc->pIBIndex ) break;
129588 struct SrcList_item *pSrc = &pBuilder->pWInfo->pTabList->a[pNew->iTab];
129617 pIdxInfo->colUsed = (sqlite3_int64)pSrc->colUsed;
129620 rc = vtabBestIndex(pParse, pSrc->pTab, pIdxInfo);
129640 sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
129733 struct SrcList_item *pSrc; /* The FROM clause term to search */
129745 pSrc = &pWInfo->pTabList->a[pNew->iTab];
129746 assert( IsVirtual(pSrc->pTab) );
129747 p = allocateIndexInfo(pParse, pWC, mUnusable, pSrc, pBuilder->pOrderBy);
134624 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
134625 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
134626 …if( yymsp[0].minor.yy148 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy14…
160604 u8 *pSrc = &pDst[pRtree->nBytesPerCell];
160606 memmove(pDst, pSrc, nByte);