Lines Matching refs:pSelect

9928   Select *pSelect;     /* NULL for tables.  Points to definition if a view. */
10248 ** Expr.x.pSelect is used if the expression is a sub-select or an expression of
10250 ** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is
10287 ** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately
10308 Select *pSelect; /* Used for sub-selects and "<expr> IN (<select>)" */
10341 #define EP_VarSelect 0x0020 /* pSelect is correlated, not constant */
10347 #define EP_xIsSelect 0x0800 /* x.pSelect is valid (otherwise x.pList is) */
10494 Select *pSelect; /* A SELECT statement used in place of a table name */
10501 u8 iSelectId; /* If pSelect!=0, the id of the sub-select in EQP */
10997 * pSelect -> If this is an INSERT INTO ... SELECT ... statement, then
11024 Select *pSelect; /* SELECT statment or RHS of INSERT INTO .. SELECT ... */
69989 if( pTab && pTab->pSelect ){
71712 if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort;
71767 if( sqlite3WalkSelect(pWalker, pItem->pSelect) ){
72107 assert( pExpr->x.pSelect==0 );
72391 sqlite3WalkSelect(pWalker, pExpr->x.pSelect);
72464 Select *pSelect, /* The SELECT statement with the ORDER BY clause */
72475 pEList = pSelect->pEList;
72481 nc.pSrcList = pSelect->pSrc;
72537 Select *pSelect /* The SELECT statement containing the ORDER BY */
72545 pOrderBy = pSelect->pOrderBy;
72557 pSelect->pNext = 0;
72558 while( pSelect->pPrior ){
72559 pSelect->pPrior->pNext = pSelect;
72560 pSelect = pSelect->pPrior;
72562 while( pSelect && moreToDo ){
72565 pEList = pSelect->pEList;
72583 iCol = resolveOrderByTermToExprList(pParse, pSelect, pDup);
72603 pSelect = pSelect->pNext;
72617 ** the SELECT statement pSelect. If any term is reference to a
72627 Select *pSelect, /* The SELECT statement containing the clause */
72643 pEList = pSelect->pEList;
72658 ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
72677 Select *pSelect, /* The SELECT statement holding pOrderBy */
72688 nResult = pSelect->pEList->nExpr;
72692 iCol = resolveAsName(pParse, pSelect->pEList, pE);
72719 return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType);
72798 if( pItem->pSelect ){
72805 ** pItem->pSelect, check if this value has changed. If so, then
72806 ** SELECT statement pItem->pSelect must be correlated. Set the
72811 sqlite3ResolveSelectNames(pParse, pItem->pSelect, pOuterNC);
73057 return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr);
73188 aff = sqlite3CompareAffinity(pExpr->x.pSelect->pEList->a[0].pExpr, aff);
73339 ** Expr.pSelect member has a height of 1. Any other expression
73348 heightOfSelect(p->x.pSelect, &nHeight);
73647 sqlite3SelectDelete(db, p->x.pSelect);
73745 ** descended from the Expr.x.pList or Expr.x.pSelect variables).
73819 /* Fill in the pNew->x.pSelect or pNew->x.pList member. */
73821 pNew->x.pSelect = sqlite3SelectDup(db, p->x.pSelect, isReduced);
73934 pNewItem->pSelect = sqlite3SelectDup(db, pOldItem->pSelect, flags);
74383 if( pSrc->a[0].pSelect ) return 0; /* FROM is not a subquery or view */
74386 assert( pTab->pSelect==0 ); /* FROM clause is not a view */
74462 p = (ExprHasProperty(pX, EP_xIsSelect) ? pX->x.pSelect : 0);
74673 pExpr->x.pSelect->iLimit = 0;
74674 if( sqlite3Select(pParse, pExpr->x.pSelect, &dest) ){
74677 pEList = pExpr->x.pSelect->pEList;
74760 pSel = pExpr->x.pSelect;
76675 static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){
76679 sqlite3WalkSelect(pWalker, pSelect);
77224 if( pTab->pSelect ){
77548 if( pTab->pSelect ){
78802 if( sqlite3FixSelect(pFix, pItem->pSelect) ) return 1;
78811 Select *pSelect /* The SELECT statement to be fixed to one database */
78813 while( pSelect ){
78814 if( sqlite3FixExprList(pFix, pSelect->pEList) ){
78817 if( sqlite3FixSrcList(pFix, pSelect->pSrc) ){
78820 if( sqlite3FixExpr(pFix, pSelect->pWhere) ){
78823 if( sqlite3FixExpr(pFix, pSelect->pHaving) ){
78826 pSelect = pSelect->pPrior;
78837 if( sqlite3FixSelect(pFix, pExpr->x.pSelect) ) return 1;
78870 if( sqlite3FixSelect(pFix, pStep->pSelect) ){
79674 sqlite3SelectDelete(db, pTable->pSelect);
80586 ** If the pSelect argument is not NULL, it means that this routine
80595 Select *pSelect /* Select from a "CREATE ... AS SELECT" */
80601 if( (pEnd==0 && pSelect==0) || db->mallocFailed ){
80607 assert( !db->init.busy || !pSelect );
80664 if( p->pSelect==0 ){
80689 if( pSelect ){
80698 sqlite3Select(pParse, pSelect, &dest);
80701 pSelTab = sqlite3ResultSetOfSelect(pParse, pSelect);
80713 if( pSelect ){
80781 if( !p->pSelect ){
80784 assert( !pSelect && pCons && pEnd );
80804 Select *pSelect, /* A SELECT statement that will become the new view */
80819 sqlite3SelectDelete(db, pSelect);
80825 sqlite3SelectDelete(db, pSelect);
80831 && sqlite3FixSelect(&sFix, pSelect)
80833 sqlite3SelectDelete(db, pSelect);
80842 p->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
80843 sqlite3SelectDelete(db, pSelect);
80928 assert( pTable->pSelect );
80929 pSel = sqlite3SelectDup(db, pTable->pSelect, 0);
80978 if( pTab->pSelect ){
81219 if( isView && pTab->pSelect==0 ){
81223 if( !isView && pTab->pSelect ){
81671 if( pTab->pSelect ){
82396 if( pItem->pSelect ){
82397 sqlite3SrcListAssignCursors(pParse, pItem->pSelect->pSrc);
82416 sqlite3SelectDelete(db, pItem->pSelect);
82466 pItem->pSelect = pSubquery;
83472 if( !viewOk && pTab->pSelect ){
83497 pDup = sqlite3SelectDup(db, pView->pSelect, 0);
83506 pFrom->a[0].pSelect = pDup;
83543 Select *pSelect = NULL; /* Complete SELECT tree */
83585 pSelect = sqlite3SelectNew(pParse,pEList,pSelectSrc,pWhere,0,0,
83587 if( pSelect == 0 ) return 0;
83595 pInClause->x.pSelect = pSelect;
83602 sqlite3SelectDelete(pParse->db, pSelect);
83666 isView = pTab->pSelect!=0;
83945 if( pTab->pSelect==0 ){
84040 if( pTab->pSelect || (pParse->db->flags & SQLITE_IdxRealAsInt)!=0 ){
86271 sqlite3SelectDelete(dbMem, pStep->pSelect);
86296 if( (db->flags&SQLITE_ForeignKeys) && !IsVirtual(pTab) && !pTab->pSelect ){
86652 Select *pSelect = 0; /* If RESTRICT, "SELECT RAISE(...)" */
86743 pSelect = sqlite3SelectNew(pParse,
86769 pStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
86782 sqlite3SelectDelete(db, pSelect);
87206 Select *pSelect, /* A SELECT statement to use as the data source */
87222 ** statement above, and pSelect is NULL. For the second form, pList is
87223 ** NULL and pSelect is a pointer to the select statement used to generate
87317 Select *pSelect, /* A SELECT statement to use as the data source */
87387 isView = pTab->pSelect!=0;
87420 sqlite3BeginWriteOperation(pParse, pSelect || pTrigger, iDb);
87432 if( pColumn==0 && xferOptimization(pParse, pTab, pSelect, onError, iDb) ){
87449 if( pSelect ){
87484 rc = sqlite3Select(pParse, pSelect, &dest);
87496 assert( pSelect->pEList );
87497 nColumn = pSelect->pEList->nExpr;
87661 }else if( pSelect ){
87705 assert( pSelect==0 ); /* Otherwise useTempTable is true */
87734 assert( pSelect==0 ); /* Otherwise useTempTable is true */
87769 }else if( pSelect ){
87837 }else if( pSelect ){
87888 }else if( pSelect ){
87924 sqlite3SelectDelete(db, pSelect);
88044 assert( pTab->pSelect==0 ); /* This table is not a VIEW */
88324 assert( pTab->pSelect==0 ); /* This table is not a VIEW */
88490 Select *pSelect, /* A SELECT statement to use as the data source */
88497 struct SrcList_item *pItem; /* An element of pSelect->pSrc */
88510 if( pSelect==0 ){
88527 assert(pSelect->pSrc); /* allocated even if there is no FROM clause */
88528 if( pSelect->pSrc->nSrc!=1 ){
88531 if( pSelect->pSrc->a[0].pSelect ){
88534 if( pSelect->pWhere ){
88537 if( pSelect->pOrderBy ){
88542 if( pSelect->pGroupBy ){
88545 if( pSelect->pLimit ){
88548 assert( pSelect->pOffset==0 ); /* Must be so if pLimit==0 */
88549 if( pSelect->pPrior ){
88552 if( pSelect->selFlags & SF_Distinct ){
88555 pEList = pSelect->pEList;
88569 pItem = pSelect->pSrc->a;
88582 if( pSrc->pSelect ){
92764 Select *pSelect, /* The whole SELECT statement */
92777 if( pSelect->selFlags & SF_UseSorter ){
92785 if( pSelect->iLimit ){
92788 if( pSelect->iOffset ){
92789 iLimit = pSelect->iOffset+1;
92791 iLimit = pSelect->iLimit;
93377 pS = pTabList->a[j].pSelect;
93449 Select *pS = pExpr->x.pSelect;
93685 Select *pSelect /* SELECT used to determine types and collations */
93695 assert( pSelect!=0 );
93696 assert( (pSelect->selFlags & SF_Resolved)!=0 );
93697 assert( nCol==pSelect->pEList->nExpr || db->mallocFailed );
93700 sNC.pSrcList = pSelect->pSrc;
93701 a = pSelect->pEList->a;
93718 SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect){
93726 sqlite3SelectPrep(pParse, pSelect, 0);
93728 while( pSelect->pPrior ) pSelect = pSelect->pPrior;
93740 selectColumnsFromExprList(pParse, pSelect->pEList, &pTab->nCol, &pTab->aCol);
93741 selectAddColumnTypeAndCollation(pParse, pTab->nCol, pTab->aCol, pSelect);
94886 substSelect(db, pExpr->x.pSelect, iTable, pEList);
94925 substSelect(db, pItem->pSelect, iTable, pEList);
95071 pSub = pSubitem->pSelect;
95240 pSub = pSub1 = pSubitem->pSelect;
95251 pSubitem->pSelect = 0;
95463 || p->pSrc->nSrc!=1 || p->pSrc->a[0].pSelect
95469 assert( pTab && !pTab->pSelect && pExpr );
95514 ** fill pTabList->a[].pSelect with a copy of the SELECT statement
95566 Select *pSel = pFrom->pSelect;
95589 if( pTab->pSelect || IsVirtual(pTab) ){
95592 assert( pFrom->pSelect==0 );
95593 pFrom->pSelect = sqlite3SelectDup(db, pTab->pSelect, 0);
95594 sqlite3WalkSelect(pWalker, pFrom->pSelect);
95775 static void sqlite3SelectExpand(Parse *pParse, Select *pSelect){
95780 sqlite3WalkSelect(&w, pSelect);
95813 Select *pSel = pFrom->pSelect;
95832 static void sqlite3SelectAddTypeInfo(Parse *pParse, Select *pSelect){
95838 sqlite3WalkSelect(&w, pSelect);
96150 Select *pSub = pItem->pSelect;
96891 if( pItem->pSelect ){
96893 sqlite3PrintSelect(pItem->pSelect, indent+10);
97160 sqlite3SelectDelete(db, pTmp->pSelect);
97338 if( pTab->pSelect && tr_tm!=TK_INSTEAD ){
97343 if( !pTab->pSelect && tr_tm==TK_INSTEAD ){
97479 ** Turn a SELECT statement (that the pSelect parameter points to) into
97485 SQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(sqlite3 *db, Select *pSelect){
97488 sqlite3SelectDelete(db, pSelect);
97492 pTriggerStep->pSelect = pSelect;
97533 Select *pSelect, /* A SELECT statement that supplies values */
97538 assert(pEList == 0 || pSelect == 0);
97539 assert(pEList != 0 || pSelect != 0 || db->mallocFailed);
97543 pTriggerStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
97551 sqlite3SelectDelete(db, pSelect);
97880 sqlite3SelectDup(db, pStep->pSelect, 0),
97895 Select *pSelect = sqlite3SelectDup(db, pStep->pSelect, 0);
97897 sqlite3Select(pParse, pSelect, &sDest);
97898 sqlite3SelectDelete(db, pSelect);
98322 if( !pTab->pSelect ){
98410 isView = pTab->pSelect!=0;
98867 Select *pSelect = 0; /* The SELECT statement */
98894 pSelect = sqlite3SelectNew(pParse, pEList, pSrc, pWhere, 0, 0, 0, 0, 0, 0);
98907 sqlite3Select(pParse, pSelect, &dest);
98927 sqlite3SelectDelete(db, pSelect);
99964 && !pParse->pNewTable->pSelect
100796 mask |= exprSelectTableUsage(pMaskSet, p->x.pSelect);
100824 mask |= exprSelectTableUsage(pMaskSet, pSrc->a[i].pSelect);
101478 pTerm->prereqRight = exprSelectTableUsage(pMaskSet, pExpr->x.pSelect);
104062 if( pItem->pSelect ){
105288 if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ){
105478 && pTab->pSelect==0
108349 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108363 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108379 yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
108394 p->x.pSelect = yymsp[-1].minor.yy387;
112703 if( !pTab || pTab->pSelect ){
123123 sqlite3_stmt *pSelect;
123126 rc = fts3SqlStmt(p, SQL_SELECT_CONTENT_BY_ROWID, &pSelect, &pRowid);
123128 if( SQLITE_ROW==sqlite3_step(pSelect) ){
123131 const char *zText = (const char *)sqlite3_column_text(pSelect, i);
123134 sqlite3_reset(pSelect);
123138 aSz[p->nColumn] += sqlite3_column_bytes(pSelect, i);
123141 rc = sqlite3_reset(pSelect);
123143 sqlite3_reset(pSelect);
126541 sqlite3_stmt *pSelect = 0;
126557 rc = fts3MatchinfoSelectDoctotal(pTab, &pSelect, &nDoc, 0);
126567 rc = fts3MatchinfoSelectDoctotal(pTab, &pSelect, &nDoc, &a);
126612 rc = fts3MatchinfoSelectDoctotal(pTab, &pSelect, &pInfo->nDoc, 0);
126626 sqlite3_reset(pSelect);