Lines Matching refs:pSub
79506 Mem *pSub, /* Storage for keeping track of subprogram nesting */
79528 if( pSub!=0 ){
79529 if( pSub->flags&MEM_Blob ){
79532 nSub = pSub->n/sizeof(Vdbe*);
79533 apSub = (SubProgram **)pSub->z;
79570 if( pSub!=0 && aOp[i].p4type==P4_SUBPROGRAM ){
79577 p->rc = sqlite3VdbeMemGrow(pSub, nByte, nSub!=0);
79582 apSub = (SubProgram **)pSub->z;
79584 MemSetTypeFlag(pSub, MEM_Blob);
79585 pSub->n = nSub*sizeof(SubProgram*);
79651 Mem *pSub = 0; /* Memory cell hold array of subprogs */
79684 pSub = &p->aMem[9];
79686 pSub = 0;
79690 rc = sqlite3VdbeNextOpcode(p, pSub, p->explain==2, &p->pc, &i, &aOp);
80977 SubProgram *pSub, *pNext;
80980 for(pSub=p->pProgram; pSub; pSub=pNext){
80981 pNext = pSub->pNext;
80982 vdbeFreeOpArray(db, pSub->aOp, pSub->nOp);
80983 sqlite3DbFree(db, pSub);
99105 Select *pSub = p->pSrc->a[0].pSelect;
99107 assert( pSub->pPrior && pSub->pOrderBy==0 );
99108 pSub->pOrderBy = p->pOrderBy;
99205 Select *pSub = p->pSrc->a[0].pSelect;
99206 p->pOrderBy = pSub->pOrderBy;
99207 pSub->pOrderBy = 0;
132717 Select *pSub; /* The inner query or "subquery" */
132739 pSub = pSubitem->pSelect;
132740 assert( pSub!=0 );
132743 if( p->pWin || pSub->pWin ) return 0; /* Restriction (25) */
132746 pSubSrc = pSub->pSrc;
132753 if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */
132754 if( pSub->pLimit && pSub->pLimit->pRight ) return 0; /* Restriction (14) */
132755 if( (p->selFlags & SF_Compound)!=0 && pSub->pLimit ){
132759 if( pSub->selFlags & SF_Distinct ) return 0; /* Restriction (4) */
132760 if( pSub->pLimit && (pSrc->nSrc>1 || isAgg) ){
132763 if( p->pOrderBy && pSub->pOrderBy ){
132766 if( isAgg && pSub->pOrderBy ) return 0; /* Restriction (16) */
132767 if( pSub->pLimit && p->pWhere ) return 0; /* Restriction (19) */
132768 if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){
132771 if( pSub->selFlags & (SF_Recursive) ){
132820 if( pSub->pPrior ){
132821 if( pSub->pOrderBy ){
132827 for(pSub1=pSub; pSub1; pSub1=pSub1->pPrior){
132830 assert( pSub->pSrc!=0 );
132831 assert( pSub->pEList->nExpr==pSub1->pEList->nExpr );
132859 assert( (p->selFlags & SF_Recursive)==0 || pSub->pPrior==0 );
132863 pSub->selId, pSub, iFrom));
132904 for(pSub=pSub->pPrior; pSub; pSub=pSub->pPrior){
132934 pSub = pSub1 = pSubitem->pSelect;
132979 for(pParent=p; pParent; pParent=pParent->pPrior, pSub=pSub->pPrior){
132982 assert( pSub!=0 );
132983 pSubSrc = pSub->pSrc; /* FROM clause of subquery */
133042 if( pSub->pOrderBy && (pParent->selFlags & SF_NoopOrderBy)==0 ){
133053 ExprList *pOrderBy = pSub->pOrderBy;
133059 pSub->pOrderBy = 0;
133061 pWhere = pSub->pWhere;
133062 pSub->pWhere = 0;
133073 x.pEList = pSub->pEList;
133079 pParent->selFlags |= pSub->selFlags & SF_Compound;
133080 assert( (pSub->selFlags & SF_Distinct)==0 ); /* restriction (17b) */
133088 if( pSub->pLimit ){
133089 pParent->pLimit = pSub->pLimit;
133090 pSub->pLimit = 0;
134053 Select *pSub = pFrom->pSelect;
134061 if( pSub==0 || (pSub->selFlags & SF_NestedFrom)==0 ){
134062 pSub = 0;
134076 if( zTName && pSub
134077 && sqlite3MatchEName(&pSub->pEList->a[j], 0, zTName, 0)==0
134131 if( pSub ){
134132 pX->zEName = sqlite3DbStrDup(db, pSub->pEList->a[j].zEName);
134596 Select *pSub, *pPrior;
134609 pSub = p->pSrc->a[0].pSelect;
134610 if( pSub==0 ) return 0; /* The FROM is a subquery */
134611 if( pSub->pPrior==0 ) return 0; /* Must be a compound ry */
134613 if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */
134614 if( pSub->pWhere ) return 0; /* No WHERE clause */
134615 if( pSub->pLimit ) return 0; /* No LIMIT clause */
134616 if( pSub->selFlags & SF_Aggregate ) return 0; /* Not an aggregate */
134617 pSub = pSub->pPrior; /* Repeat over compound */
134618 }while( pSub );
134625 pSub = p->pSrc->a[0].pSelect;
134629 while( pSub ){
134631 pPrior = pSub->pPrior;
134632 pSub->pPrior = 0;
134633 pSub->pNext = 0;
134634 pSub->selFlags |= SF_Aggregate;
134635 pSub->selFlags &= ~SF_Compound;
134636 pSub->nSelectRow = 0;
134637 sqlite3ExprListDelete(db, pSub->pEList);
134639 pSub->pEList = sqlite3ExprListAppend(pParse, 0, pTerm);
134641 sqlite3PExprAddSelect(pParse, pTerm, pSub);
134647 pSub = pPrior;
134767 Select *pSub = pItem->pSelect;
134784 if( pSub==0 ) continue;
134788 if( pTab->nCol!=pSub->pEList->nExpr ){
134790 pTab->nCol, pTab->zName, pSub->pEList->nExpr);
134801 if( (pSub->selFlags & SF_Aggregate)!=0 ) continue;
134802 assert( pSub->pGroupBy==0 );
134822 if( pSub->pOrderBy!=0
134897 Select *pSub;
134925 pSub = pItem->pSelect;
134926 if( pSub==0 ) continue;
134955 && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
134961 ("After WHERE-clause push-down into subquery %d:\n", pSub->selId));
134995 ExplainQueryPlan((pParse, 1, "CO-ROUTINE %u", pSub->selId));
134996 sqlite3Select(pParse, pSub, &dest);
134997 pItem->pTab->nRowLogEst = pSub->nSelectRow;
135031 pSub->nSelectRow = pPrior->pSelect->nSelectRow;
135034 ExplainQueryPlan((pParse, 1, "MATERIALIZE %u", pSub->selId));
135035 sqlite3Select(pParse, pSub, &dest);
135037 pItem->pTab->nRowLogEst = pSub->nSelectRow;
151229 ExprList *pSub;
151282 if( p->pSub ){
151284 for(i=0; i<p->pSub->nExpr; i++){
151285 if( 0==sqlite3ExprCompare(0, p->pSub->a[i].pExpr, pExpr, -1) ){
151294 p->pSub = sqlite3ExprListAppend(pParse, p->pSub, pDup);
151296 if( p->pSub ){
151304 pExpr->iColumn = (iCol<0 ? p->pSub->nExpr-1: iCol);
151360 sRewrite.pSub = *ppSub;
151372 *ppSub = sRewrite.pSub;
151393 Expr *pSub;
151394 for(pSub=pDup; ExprHasProperty(pSub, EP_Skip); pSub=pSub->pLeft){
151395 assert( pSub );
151397 if( sqlite3ExprIsInteger(pSub, &iDummy) ){
151398 pSub->op = TK_NULL;
151399 pSub->flags &= ~(EP_IntValue|EP_IsTrue|EP_IsFalse);
151400 pSub->u.zToken = 0;
151439 Select *pSub = 0; /* The subquery */
151534 pSub = sqlite3SelectNew(
151540 p->pSrc->a[0].pSelect = pSub;
151542 pSub->selFlags |= SF_Expanded;
151543 pTab2 = sqlite3ResultSetOfSelect(pParse, pSub, SQLITE_AFF_NONE);
151544 pSub->selFlags |= (selFlags & SF_Aggregate);
151559 sqlite3WalkSelect(&w, pSub);
151562 sqlite3SelectDelete(db, pSub);
214234 static void fts5ExprAddChildren(Fts5ExprNode *p, Fts5ExprNode *pSub){
214235 if( p->eType!=FTS5_NOT && pSub->eType==p->eType ){
214236 int nByte = sizeof(Fts5ExprNode*) * pSub->nChild;
214237 memcpy(&p->apChild[p->nChild], pSub->apChild, nByte);
214238 p->nChild += pSub->nChild;
214239 sqlite3_free(pSub);
214241 p->apChild[p->nChild++] = pSub;
218772 const u8 *pSub = pPos;
218773 int nSub = fts5IndexExtractCol(&pSub, nPos, pColset->aiCol[i]);
218775 fts5BufferAppendBlob(pRc, pBuf, nSub, pSub);