Lines Matching refs:pSelect
10182 Select *pSelect; /* NULL for tables. Points to definition if a view. */ member
10564 Select *pSelect; /* Used for sub-selects and "<expr> IN (<select>)" */ member
10748 Select *pSelect; /* A SELECT statement used in place of a table name */ member
11281 Select *pSelect; /* SELECT statment or RHS of INSERT INTO .. SELECT ... */ member
71383 if( pTab && pTab->pSelect ){
73114 if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort;
73169 if( sqlite3WalkSelect(pWalker, pItem->pSelect) ){
73514 assert( pExpr->x.pSelect==0 );
73798 sqlite3WalkSelect(pWalker, pExpr->x.pSelect);
73871 Select *pSelect, /* The SELECT statement with the ORDER BY clause */
73882 pEList = pSelect->pEList;
73888 nc.pSrcList = pSelect->pSrc;
73944 Select *pSelect /* The SELECT statement containing the ORDER BY */
73952 pOrderBy = pSelect->pOrderBy;
73964 pSelect->pNext = 0;
73965 while( pSelect->pPrior ){
73966 pSelect->pPrior->pNext = pSelect;
73967 pSelect = pSelect->pPrior;
73969 while( pSelect && moreToDo ){
73972 pEList = pSelect->pEList;
73990 iCol = resolveOrderByTermToExprList(pParse, pSelect, pDup);
74010 pSelect = pSelect->pNext;
74034 Select *pSelect, /* The SELECT statement containing the clause */
74050 pEList = pSelect->pEList;
74084 Select *pSelect, /* The SELECT statement holding pOrderBy */
74095 nResult = pSelect->pEList->nExpr;
74099 iCol = resolveAsName(pParse, pSelect->pEList, pE);
74126 return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType);
74205 if( pItem->pSelect ){
74218 sqlite3ResolveSelectNames(pParse, pItem->pSelect, pOuterNC);
74464 return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr);
74595 aff = sqlite3CompareAffinity(pExpr->x.pSelect->pEList->a[0].pExpr, aff);
74755 heightOfSelect(p->x.pSelect, &nHeight);
75055 sqlite3SelectDelete(db, p->x.pSelect);
75229 pNew->x.pSelect = sqlite3SelectDup(db, p->x.pSelect, isReduced);
75343 pNewItem->pSelect = sqlite3SelectDup(db, pOldItem->pSelect, flags);
75795 if( pSrc->a[0].pSelect ) return 0; /* FROM is not a subquery or view */
75798 assert( pTab->pSelect==0 ); /* FROM clause is not a view */
75884 p = (ExprHasProperty(pX, EP_xIsSelect) ? pX->x.pSelect : 0);
76101 pExpr->x.pSelect->iLimit = 0;
76102 if( sqlite3Select(pParse, pExpr->x.pSelect, &dest) ){
76105 pEList = pExpr->x.pSelect->pEList;
76188 pSel = pExpr->x.pSelect;
77517 sqlite3ExplainSelect(pOut, pExpr->x.pSelect);
77523 sqlite3ExplainSelect(pOut, pExpr->x.pSelect);
77532 sqlite3ExplainSelect(pOut, pExpr->x.pSelect);
78357 static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){
78361 sqlite3WalkSelect(pWalker, pSelect);
78914 if( pTab->pSelect ){
79238 if( pTab->pSelect ){
80898 if( sqlite3FixSelect(pFix, pItem->pSelect) ) return 1;
80907 Select *pSelect /* The SELECT statement to be fixed to one database */
80909 while( pSelect ){
80910 if( sqlite3FixExprList(pFix, pSelect->pEList) ){
80913 if( sqlite3FixSrcList(pFix, pSelect->pSrc) ){
80916 if( sqlite3FixExpr(pFix, pSelect->pWhere) ){
80919 if( sqlite3FixExpr(pFix, pSelect->pHaving) ){
80922 pSelect = pSelect->pPrior;
80933 if( sqlite3FixSelect(pFix, pExpr->x.pSelect) ) return 1;
80966 if( sqlite3FixSelect(pFix, pStep->pSelect) ){
81770 sqlite3SelectDelete(db, pTable->pSelect);
82691 Select *pSelect /* Select from a "CREATE ... AS SELECT" */
82697 if( (pEnd==0 && pSelect==0) || db->mallocFailed ){
82703 assert( !db->init.busy || !pSelect );
82760 if( p->pSelect==0 ){
82785 if( pSelect ){
82794 sqlite3Select(pParse, pSelect, &dest);
82797 pSelTab = sqlite3ResultSetOfSelect(pParse, pSelect);
82809 if( pSelect ){
82876 if( !p->pSelect ){
82879 assert( !pSelect && pCons && pEnd );
82899 Select *pSelect, /* A SELECT statement that will become the new view */
82914 sqlite3SelectDelete(db, pSelect);
82920 sqlite3SelectDelete(db, pSelect);
82926 && sqlite3FixSelect(&sFix, pSelect)
82928 sqlite3SelectDelete(db, pSelect);
82937 p->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
82938 sqlite3SelectDelete(db, pSelect);
83023 assert( pTable->pSelect );
83024 pSel = sqlite3SelectDup(db, pTable->pSelect, 0);
83073 if( pTab->pSelect ){
83386 if( isView && pTab->pSelect==0 ){
83390 if( !isView && pTab->pSelect ){
83788 if( pTab->pSelect ){
84511 if( pItem->pSelect ){
84512 sqlite3SrcListAssignCursors(pParse, pItem->pSelect->pSrc);
84531 sqlite3SelectDelete(db, pItem->pSelect);
84581 pItem->pSelect = pSubquery;
85581 if( !viewOk && pTab->pSelect ){
85606 pDup = sqlite3SelectDup(db, pView->pSelect, 0);
85615 pFrom->a[0].pSelect = pDup;
85652 Select *pSelect = NULL; /* Complete SELECT tree */
85693 pSelect = sqlite3SelectNew(pParse,pEList,pSelectSrc,pWhere,0,0,
85695 if( pSelect == 0 ) return 0;
85703 pInClause->x.pSelect = pSelect;
85710 sqlite3SelectDelete(pParse->db, pSelect);
85774 isView = pTab->pSelect!=0;
86053 if( pTab->pSelect==0 ){
86148 if( pTab->pSelect || (pParse->db->flags & SQLITE_IdxRealAsInt)!=0 ){
88388 sqlite3SelectDelete(dbMem, pStep->pSelect);
88413 if( (db->flags&SQLITE_ForeignKeys) && !IsVirtual(pTab) && !pTab->pSelect ){
88769 Select *pSelect = 0; /* If RESTRICT, "SELECT RAISE(...)" */
88860 pSelect = sqlite3SelectNew(pParse,
88886 pStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
88899 sqlite3SelectDelete(db, pSelect);
89325 Select *pSelect, /* A SELECT statement to use as the data source */
89436 Select *pSelect, /* A SELECT statement to use as the data source */
89506 isView = pTab->pSelect!=0;
89539 sqlite3BeginWriteOperation(pParse, pSelect || pTrigger, iDb);
89551 if( pColumn==0 && xferOptimization(pParse, pTab, pSelect, onError, iDb) ){
89568 if( pSelect ){
89603 rc = sqlite3Select(pParse, pSelect, &dest);
89615 assert( pSelect->pEList );
89616 nColumn = pSelect->pEList->nExpr;
89780 }else if( pSelect ){
89824 assert( pSelect==0 ); /* Otherwise useTempTable is true */
89853 assert( pSelect==0 ); /* Otherwise useTempTable is true */
89888 }else if( pSelect ){
89956 }else if( pSelect ){
90007 }else if( pSelect ){
90043 sqlite3SelectDelete(db, pSelect);
90163 assert( pTab->pSelect==0 ); /* This table is not a VIEW */
90443 assert( pTab->pSelect==0 ); /* This table is not a VIEW */
90603 Select *pSelect, /* A SELECT statement to use as the data source */
90623 if( pSelect==0 ){
90638 assert(pSelect->pSrc); /* allocated even if there is no FROM clause */
90639 if( pSelect->pSrc->nSrc!=1 ){
90642 if( pSelect->pSrc->a[0].pSelect ){
90645 if( pSelect->pWhere ){
90648 if( pSelect->pOrderBy ){
90653 if( pSelect->pGroupBy ){
90656 if( pSelect->pLimit ){
90659 assert( pSelect->pOffset==0 ); /* Must be so if pLimit==0 */
90660 if( pSelect->pPrior ){
90663 if( pSelect->selFlags & SF_Distinct ){
90666 pEList = pSelect->pEList;
90680 pItem = pSelect->pSrc->a;
90693 if( pSrc->pSelect ){
94957 Select *pSelect, /* The whole SELECT statement */
94970 if( pSelect->selFlags & SF_UseSorter ){
94978 if( pSelect->iLimit ){
94981 if( pSelect->iOffset ){
94982 iLimit = pSelect->iOffset+1;
94984 iLimit = pSelect->iLimit;
95570 pS = pTabList->a[j].pSelect;
95642 Select *pS = pExpr->x.pSelect;
95881 Select *pSelect /* SELECT used to determine types and collations */
95891 assert( pSelect!=0 );
95892 assert( (pSelect->selFlags & SF_Resolved)!=0 );
95893 assert( nCol==pSelect->pEList->nExpr || db->mallocFailed );
95896 sNC.pSrcList = pSelect->pSrc;
95897 a = pSelect->pEList->a;
95914 SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect){
95922 sqlite3SelectPrep(pParse, pSelect, 0);
95924 while( pSelect->pPrior ) pSelect = pSelect->pPrior;
95936 selectColumnsFromExprList(pParse, pSelect->pEList, &pTab->nCol, &pTab->aCol);
95937 selectAddColumnTypeAndCollation(pParse, pTab->nCol, pTab->aCol, pSelect);
97086 substSelect(db, pExpr->x.pSelect, iTable, pEList);
97125 substSelect(db, pItem->pSelect, iTable, pEList);
97276 pSub = pSubitem->pSelect;
97447 pSub = pSub1 = pSubitem->pSelect;
97458 pSubitem->pSelect = 0;
97670 || p->pSrc->nSrc!=1 || p->pSrc->a[0].pSelect
97676 assert( pTab && !pTab->pSelect && pExpr );
97773 Select *pSel = pFrom->pSelect;
97796 if( pTab->pSelect || IsVirtual(pTab) ){
97799 assert( pFrom->pSelect==0 );
97800 pFrom->pSelect = sqlite3SelectDup(db, pTab->pSelect, 0);
97801 sqlite3WalkSelect(pWalker, pFrom->pSelect);
97982 static void sqlite3SelectExpand(Parse *pParse, Select *pSelect){
97987 sqlite3WalkSelect(&w, pSelect);
98020 Select *pSel = pFrom->pSelect;
98039 static void sqlite3SelectAddTypeInfo(Parse *pParse, Select *pSelect){
98045 sqlite3WalkSelect(&w, pSelect);
98366 Select *pSub = pItem->pSelect;
99080 if( pItem->pSelect ){
99081 sqlite3ExplainSelect(pVdbe, pItem->pSelect);
99376 sqlite3SelectDelete(db, pTmp->pSelect);
99554 if( pTab->pSelect && tr_tm!=TK_INSTEAD ){
99559 if( !pTab->pSelect && tr_tm==TK_INSTEAD ){
99701 SQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(sqlite3 *db, Select *pSelect){
99704 sqlite3SelectDelete(db, pSelect);
99708 pTriggerStep->pSelect = pSelect;
99749 Select *pSelect, /* A SELECT statement that supplies values */
99754 assert(pEList == 0 || pSelect == 0);
99755 assert(pEList != 0 || pSelect != 0 || db->mallocFailed);
99759 pTriggerStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
99767 sqlite3SelectDelete(db, pSelect);
100096 sqlite3SelectDup(db, pStep->pSelect, 0),
100111 Select *pSelect = sqlite3SelectDup(db, pStep->pSelect, 0);
100113 sqlite3Select(pParse, pSelect, &sDest);
100114 sqlite3SelectDelete(db, pSelect);
100539 if( !pTab->pSelect ){
100627 isView = pTab->pSelect!=0;
101087 Select *pSelect = 0; /* The SELECT statement */
101114 pSelect = sqlite3SelectNew(pParse, pEList, pSrc, pWhere, 0, 0, 0, 0, 0, 0);
101127 sqlite3Select(pParse, pSelect, &dest);
101147 sqlite3SelectDelete(db, pSelect);
102187 && !pParse->pNewTable->pSelect
103032 mask |= exprSelectTableUsage(pMaskSet, p->x.pSelect);
103060 mask |= exprSelectTableUsage(pMaskSet, pSrc->a[i].pSelect);
103717 pTerm->prereqRight = exprSelectTableUsage(pMaskSet, pExpr->x.pSelect);
106311 if( pItem->pSelect ){
107575 if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ){
107765 && pTab->pSelect==0
107891 Select *pSelect;
109278 sqlite3SelectDelete(pParse->db, (yypminor->yy487).pSelect);
110410 … yymsp[-2].minor.yy347, yymsp[0].minor.yy487.pList, yymsp[0].minor.yy487.pSelect, yymsp[-1].minor.…
110427 yygotominor.yy487.pSelect = 0;
110434 …yymsp[-4].minor.yy487.pSelect = sqlite3SelectNew(pParse, yymsp[-4].minor.yy487.pList, 0, 0, 0, 0, …
110438 if( yymsp[-4].minor.yy487.pSelect==0 || pRight==0 ){
110440 sqlite3SelectDelete(pParse->db, yymsp[-4].minor.yy487.pSelect);
110441 yygotominor.yy487.pSelect = 0;
110444 pRight->pPrior = yymsp[-4].minor.yy487.pSelect;
110447 yygotominor.yy487.pSelect = pRight;
110671 yygotominor.yy342.pExpr->x.pSelect = yymsp[-1].minor.yy159;
110685 yygotominor.yy342.pExpr->x.pSelect = yymsp[-1].minor.yy159;
110701 yygotominor.yy342.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
110716 p->x.pSelect = yymsp[-1].minor.yy159;
110902 … yymsp[-1].minor.yy180, yymsp[0].minor.yy487.pList, yymsp[0].minor.yy487.pSelect, yymsp[-4].minor.…
115073 if( !pTab || pTab->pSelect ){
126047 static int langidFromSelect(Fts3Table *p, sqlite3_stmt *pSelect){
126049 if( p->zLanguageid ) iLangid = sqlite3_column_int(pSelect, p->nColumn+1);
126065 sqlite3_stmt *pSelect;
126068 rc = fts3SqlStmt(p, SQL_SELECT_CONTENT_BY_ROWID, &pSelect, &pRowid);
126070 if( SQLITE_ROW==sqlite3_step(pSelect) ){
126072 int iLangid = langidFromSelect(p, pSelect);
126073 rc = fts3PendingTermsDocid(p, iLangid, sqlite3_column_int64(pSelect, 0));
126075 const char *zText = (const char *)sqlite3_column_text(pSelect, i);
126077 aSz[p->nColumn] += sqlite3_column_bytes(pSelect, i);
126080 sqlite3_reset(pSelect);
126085 rc = sqlite3_reset(pSelect);
126087 sqlite3_reset(pSelect);
129672 sqlite3_stmt *pSelect = 0;
129688 rc = fts3MatchinfoSelectDoctotal(pTab, &pSelect, &nDoc, 0);
129698 rc = fts3MatchinfoSelectDoctotal(pTab, &pSelect, &nDoc, &a);
129743 rc = fts3MatchinfoSelectDoctotal(pTab, &pSelect, &pInfo->nDoc, 0);
129757 sqlite3_reset(pSelect);