Lines Matching defs:Select
15377 typedef struct Select Select;
18419 Select *pSelect; /* View definition */
18839 ** original Select structure that describes the SELECT statement. These
18874 u32 selId; /* Select to which this AggInfo belongs */
18876 Select *pSelect; /* SELECT statement that this AggInfo supports */
18995 Select *pSelect; /* EP_xIsSelect and op = IN, EXISTS, SELECT */
19268 Select *pSelect; /* A SELECT statement used in place of a table name */
19410 Select *pWinSelect; /* SELECT statement for any window functions */
19500 struct Select {
19513 Select *pPrior; /* Prior select in a compound select statement */
19514 Select *pNext; /* Next select to the left in a compound */
19524 ** Allowed values for Select.selFlags. The "SF" prefix stands for
19525 ** "Select Flag".
19829 int nSelect; /* Number of SELECT stmts. Counter for Select.selId */
20071 Select *pSelect; /* SELECT statement or RHS of INSERT INTO SELECT ... */
20281 int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */
20282 void (*xSelectCallback2)(Walker*,Select*);/* Second callback for SELECTs */
20296 Select *pSelect; /* HAVING to WHERE clause ctx */
20327 SQLITE_PRIVATE int sqlite3WalkSelect(Walker*, Select*);
20328 SQLITE_PRIVATE int sqlite3WalkSelectExpr(Walker*, Select*);
20329 SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker*, Select*);
20331 SQLITE_PRIVATE int sqlite3SelectWalkNoop(Walker*, Select*);
20332 SQLITE_PRIVATE int sqlite3SelectWalkFail(Walker*, Select*);
20333 SQLITE_PRIVATE int sqlite3WalkerDepthIncrease(Walker*,Select*);
20334 SQLITE_PRIVATE void sqlite3WalkerDepthDecrease(Walker*,Select*);
20335 SQLITE_PRIVATE void sqlite3WalkWinDefnDummyCallback(Walker*,Select*);
20338 SQLITE_PRIVATE void sqlite3SelectWalkAssert2(Walker*, Select*);
20342 SQLITE_PRIVATE void sqlite3SelectPopWith(Walker*, Select*);
20361 Select *pSelect; /* The definition of this CTE */
20380 int bView; /* Belongs to the outermost Select of a view */
20437 ** attached to Select.pWin. The Window.pFunc and Window.pExpr
20441 ** object on a linked list attached to Select.pWinDefn.
20462 Window **ppThis; /* Pointer to this object in Select.pWin list */
20482 SQLITE_PRIVATE Select *sqlite3MultiValues(Parse *pParse, Select *pLeft, ExprList *pRow);
20483 SQLITE_PRIVATE void sqlite3MultiValuesEnd(Parse *pParse, Select *pVal);
20491 SQLITE_PRIVATE void sqlite3WindowLink(Select *pSel, Window *pWin);
20493 SQLITE_PRIVATE void sqlite3WindowCodeInit(Parse*, Select*);
20494 SQLITE_PRIVATE void sqlite3WindowCodeStep(Parse*, Select*, WhereInfo*, int, int);
20495 SQLITE_PRIVATE int sqlite3WindowRewrite(Parse*, Select*);
20755 SQLITE_PRIVATE void sqlite3TreeViewSelect(TreeView*, const Select*, u8);
20762 const IdList*, const Select*, const ExprList*,
20780 SQLITE_PRIVATE void sqlite3ShowSelect(const Select*);
20823 SQLITE_PRIVATE void sqlite3PExprAddSelect(Parse*, Expr*, Select*);
20837 SQLITE_PRIVATE Select *sqlite3ExprListToValues(Parse*, int, ExprList*);
20861 SQLITE_PRIVATE void sqlite3GenerateColumnNames(Parse *pParse, Select *pSelect);
20863 SQLITE_PRIVATE void sqlite3SubqueryColumnTypes(Parse*,Table*,Select*,char);
20864 SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse*,Select*,char);
20888 SQLITE_PRIVATE void sqlite3EndTable(Parse*,Token*,Token*,u32,Select*);
20919 SQLITE_PRIVATE void sqlite3CreateView(Parse*,Token*,Token*,Token*,ExprList*,Select*,int,int);
20942 SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, Select*, IdList*, int, Upsert*);
20953 Token*, Select*, OnOrUsing*);
20966 SQLITE_PRIVATE int sqlite3Select(Parse*, Select*, SelectDest*);
20967 SQLITE_PRIVATE Select *sqlite3SelectNew(Parse*,ExprList*,SrcList*,Expr*,ExprList*,
20969 SQLITE_PRIVATE void sqlite3SelectDelete(sqlite3*, Select*);
20982 ExprList*,Select*,u16,int);
21093 SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3*,const Select*,int);
21127 SQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(sqlite3*,Select*,
21130 Select*,u8,Upsert*,
21179 SQLITE_PRIVATE int sqlite3FixSelect(DbFixer*, Select*);
21335 SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
21337 SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
21349 SQLITE_PRIVATE void sqlite3ResolveSelectNames(Parse*, Select*, NameContext*);
21351 SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(Parse*, Select*, ExprList*, const char*);
21540 SQLITE_PRIVATE Cte *sqlite3CteNew(Parse*,Token*,ExprList*,Select*,u8);
21650 SQLITE_PRIVATE int sqlite3SelectExprHeight(const Select *);
23523 int iSelectID; /* The "Select-ID" for this loop */
31997 Select *pSel = pItem->pSelect;
32841 ** Generate a human-readable description of a Select object.
32843 SQLITE_PRIVATE void sqlite3TreeViewSelect(TreeView *pView, const Select *p, u8 moreToFollow){
33677 const Select *pSelect,
33882 SQLITE_PRIVATE void sqlite3ShowSelect(const Select *p){ sqlite3TreeViewSelect(0,p,0); }
87849 /* Select a super-journal file name */
104512 /* Select a sub-task to sort and flush the current list of in-memory
106581 ** callback is set, then the Select->pWinDefn list is traversed.
106583 SQLITE_PRIVATE void sqlite3WalkWinDefnDummyCallback(Walker *pWalker, Select *p){
106595 SQLITE_PRIVATE int sqlite3WalkSelectExpr(Walker *pWalker, Select *p){
106628 SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){
106650 ** Call sqlite3WalkExpr() for every expression in Select statement p.
106666 SQLITE_PRIVATE int sqlite3WalkSelect(Walker *pWalker, Select *p){
106689 SQLITE_PRIVATE int sqlite3WalkerDepthIncrease(Walker *pWalker, Select *pSelect){
106694 SQLITE_PRIVATE void sqlite3WalkerDepthDecrease(Walker *pWalker, Select *pSelect){
106718 SQLITE_PRIVATE int sqlite3SelectWalkNoop(Walker *NotUsed, Select *NotUsed2){
108024 Select *pSel = pNC->pWinSelect;
108222 Select *pSelect, /* The SELECT statement with the ORDER BY clause */
108297 Select *pSelect /* The SELECT statement containing the ORDER BY */
108410 Select *pSelect, /* The SELECT statement containing the clause */
108453 ** Select.pWin list of Select object pSelect.
108455 static void windowRemoveExprFromSelect(Select *pSelect, Expr *pExpr){
108488 Select *pSelect, /* The SELECT statement holding pOrderBy */
108537 ** objects belonging to the expression from the Select.pWin list. */
108549 static int resolveSelectStep(Walker *pWalker, Select *p){
108557 Select *pLeftmost; /* Left-most of SELECT of a compound */
108600 /* If the SF_Converted flags is set, then this Select object was
108607 Select *pSub = p->pSrc->a[0].pSelect;
108727 Select *pSub = p->pSrc->a[0].pSelect;
108943 Select *p, /* The SELECT statement being coded. */
109833 static void heightOfSelect(const Select *pSelect, int *pnHeight){
109834 const Select *p;
109887 SQLITE_PRIVATE int sqlite3SelectExprHeight(const Select *p){
110067 SQLITE_PRIVATE void sqlite3PExprAddSelect(Parse *pParse, Expr *pExpr, Select *pSelect){
110080 ** converts the contents of pEList to a VALUES(...) Select statement
110097 SQLITE_PRIVATE Select *sqlite3ExprListToValues(Parse *pParse, int nElem, ExprList *pEList){
110099 Select *pRet = 0;
110102 Select *pSel;
110774 ** objects found there, assembling them onto the linked list at Select->pWin.
110778 Select *pSelect = pWalker->u.pSelect;
110787 static int gatherSelectWindowsSelectCallback(Walker *pWalker, Select *p){
110790 static void gatherSelectWindows(Select *p){
110943 SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, const Select *pDup, int flags){
110944 Select *pRet = 0;
110945 Select *pNext = 0;
110946 Select **pp = &pRet;
110947 const Select *p;
110951 Select *pNew = sqlite3DbMallocRawNN(db, sizeof(*p) );
110977 /* Any prior OOM might have left the Select object incomplete.
110978 ** Delete the whole thing rather than allow an incomplete Select
110992 SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, const Select *p, int flags){
111296 SQLITE_PRIVATE int sqlite3SelectWalkFail(Walker *pWalker, Select *NotUsed){
111581 static int exprSelectWalkTableConstant(Walker *pWalker, Select *pSelect){
111963 static Select *isCandidateForInOpt(const Expr *pX){
111964 Select *p;
112129 Select *p; /* SELECT to the right of IN operator */
112349 Select *pSelect = ExprUseXSelect(pExpr) ? pExpr->x.pSelect : 0;
112511 Select *pSelect = pExpr->x.pSelect;
112520 Select *pCopy;
112634 Select *pSel; /* SELECT statement to encode */
115560 static int selectRefEnter(Walker *pWalker, Select *pSelect){
115580 static void selectRefLeave(Walker *pWalker, Select *pSelect){
116967 ** Iterate through the Select objects that are part of WITH clauses attached
116970 static void renameWalkWith(Walker *pWalker, Select *pSelect){
116981 ** fails if the Select objects on it have already been expanded and
116987 Select *p = pWith->a[i].pSelect;
117019 static int renameUnmapSelectCb(Walker *pWalker, Select *p){
117036 if( ALWAYS(p->pSrc) ){ /* Every Select as a SrcList, even if it is empty */
117137 static int renameColumnSelectCb(Walker *pWalker, Select *p){
117481 Select *pSel = sqlite3SelectNew(
117557 ** Invoke sqlite3WalkExpr() or sqlite3WalkSelect() on all Select or Expr
117688 Select *pSelect = sParse.pNewTable->u.view.pSelect;
117813 static int renameTableSelectCb(Walker *pWalker, Select *pSelect){
117901 Select *pSelect = pTab->u.view.pSelect;
118079 Select *pSelect = sParse.pNewTable->u.view.pSelect;
120946 ** Select callback used by sqlite3FixAAAA() routines.
120948 static int fixSelectCb(Walker *p, Select *pSelect){
121039 Select s;
121049 Select *pSelect /* The SELECT statement to be fixed to one database */
123997 Select *pSelect /* Select from a "CREATE ... AS SELECT" */
124348 Select *pSelect, /* A SELECT statement that will become the new view */
124440 Select *pSel; /* Copy of the SELECT that implements the view */
126336 Select *pSubquery, /* A subquery used in place of a table name */
126965 Select *pQuery, /* Query used to initialize the table */
127767 Select *pSel;
127810 Select *pSelect = NULL; /* Complete SELECT tree */
132649 Select *pSelect = 0; /* If RESTRICT, "SELECT RAISE(...)" */
133474 ** If argument pVal is a Select object returned by an sqlite3MultiValues()
133478 SQLITE_PRIVATE void sqlite3MultiValuesEnd(Parse *pParse, Select *pVal){
133519 ** for the new row. The Select object returned represents the complete
133524 ** Select object equivalent to the following (the "UNION ALL" method):
133528 ** If the VALUES clause contains a lot of rows, this compound Select
133533 ** passed to this function. The returned Select object is equivalent to:
133536 ** Select object to read co-routine
133566 SQLITE_PRIVATE Select *sqlite3MultiValues(Parse *pParse, Select *pLeft, ExprList *pRow){
133576 Select *pSelect = 0;
133596 /* Co-routine has not yet been started and the special Select object
133600 Select *pRet = sqlite3SelectNew(pParse, 0, 0, 0, 0, 0, 0, 0, 0);
133668 Select *pSelect, /* A SELECT statement to use as the data source */
133773 Select *pSelect, /* A SELECT statement to use as the data source */
133824 /* If the Select object is really just a simple VALUES() list with a
135888 Select *pSelect, /* A SELECT statement to use as the data source */
142967 ** Delete all the content of a Select structure. Deallocate the structure
142971 ** If bFree==0, Leave the first Select object unfreed
142973 static void clearSelect(sqlite3 *db, Select *p, int bFree){
142976 Select *pPrior = p->pPrior;
143014 ** Allocate a new Select structure and return a pointer to that
143017 SQLITE_PRIVATE Select *sqlite3SelectNew(
143028 Select *pNew, *pAllocated;
143029 Select standin;
143073 ** Delete the given Select structure and all of its substructures.
143075 SQLITE_PRIVATE void sqlite3SelectDelete(sqlite3 *db, Select *p){
143079 if( ALWAYS(p) ) clearSelect(db, (Select*)p, 1);
143085 static Select *findRightmost(Select *p){
143376 ** The terms of a FROM clause are contained in the Select.pSrc structure.
143377 ** The left most table is the first entry in Select.pSrc. The right-most
143385 static int sqlite3ProcessJoin(Parse *pParse, Select *p){
143546 Select *pSelect, /* The query being coded */
143568 Select *pSelect,
143589 Select *pSelect, /* The whole SELECT statement */
143997 Select *p, /* The complete select statement being coded */
144540 Select *p, /* The SELECT statement */
144812 Select *pS = 0; /* Select the column is extracted from */
144902 Select *pS;
145000 Select *pSelect /* Generate column names for this SELECT statement */
145196 ** for that Table object based on the Select object that implements the
145206 Select *pSelect, /* SELECT used to determine types and collations */
145230 Select *pS2 = pSelect;
145296 SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect, char aff){
145365 static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){
145422 static CollSeq *multiSelectCollSeq(Parse *pParse, Select *p, int iCol){
145448 static KeyInfo *multiSelectOrderByKeyInfo(Parse *pParse, Select *p, int nExtra){
145516 Select *p, /* The recursive SELECT to be coded */
145522 Select *pSetup; /* The setup query */
145523 Select *pFirstRec; /* Left-most recursive term */
145670 Select *p, /* The right-most of SELECTs to be coded */
145680 ** Because the Select object originates from a VALUES clause:
145692 Select *p, /* The right-most of SELECTs to be coded */
145727 static int hasAnchor(Select *p){
145756 ** The arrows in the diagram above represent the Select.pPrior pointer.
145765 Select *p, /* The right-most of SELECTs to be coded */
145769 Select *pPrior; /* Another SELECT immediately to our left */
145772 Select *pDelete = 0; /* Chain of simple selects to delete */
146066 Select *pLoop; /* For looping through SELECT statements */
146117 SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p){
146149 Select *p, /* The SELECT statement */
146357 Select *p, /* The right-most of SELECTs to be coded */
146361 Select *pPrior; /* Another SELECT immediately to our left */
146362 Select *pSplit; /* Left-most SELECT in the right-hand group */
146719 static void substSelect(SubstContext*, Select*, int);
146850 Select *p, /* SELECT statement in which to make substitutions */
146893 Select *pSelect, /* The complete SELECT statement */
146931 Select *p;
146971 ** Assign a new cursor number to each cursor in the FROM clause (Select.pSrc)
146990 Select *p, /* Select to renumber cursors within */
147009 static ExprList *findLeftmostExprlist(Select *pSel){
147020 static int compoundHasDifferentAffinities(Select *p){
147029 Select *pSub1;
147220 Select *p, /* The parent or outer SELECT statement */
147225 Select *pParent; /* Current UNION ALL term of the other query */
147226 Select *pSub; /* The inner query or "subquery" */
147227 Select *pSub1; /* Pointer to the rightmost select in sub-query */
147432 Select *pNew;
147435 Select *pPrior = p->pPrior;
147874 Select *p /* The query in which to propagate constants */
147934 static int pushDownWindowCheck(Parse *pParse, Select *pSubq, Expr *pExpr){
148053 Select *pSubq, /* The subquery whose WHERE clause is to be augmented */
148071 Select *pSel;
148112 Select *pX;
148213 Select *pSub; /* The subquery to be simplified */
148214 Select *pX; /* For looping over compound elements of pSub */
148347 static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){
148428 static int convertCompoundSelectToSubquery(Walker *pWalker, Select *p){
148430 Select *pNew;
148431 Select *pX;
148617 Select *pSel;
148618 Select *pLeft; /* Left-most SELECT statement */
148619 Select *pRecTerm; /* Left-most recursive term */
148762 SQLITE_PRIVATE void sqlite3SelectPopWith(Walker *pWalker, Select *p){
148782 Select *pSel = pFrom->pSelect;
148859 static int selectExpander(Walker *pWalker, Select *p){
148911 Select *pSel = pFrom->pSelect;
148967 pWalker->eCode = 1; /* Turn on Select.selId renumbering */
149248 SQLITE_PRIVATE void sqlite3SelectWalkAssert2(Walker *NotUsed, Select *NotUsed2){
149266 static void sqlite3SelectExpand(Parse *pParse, Select *pSelect){
149296 static void selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
149312 Select *pSel = pFrom->pSelect;
149329 static void sqlite3SelectAddTypeInfo(Parse *pParse, Select *pSelect){
149355 Select *p, /* The SELECT statement being coded. */
149450 Select *pSelect, /* The SELECT statement being processed */
149891 Select *pS = pWalker->u.pSelect;
149897 ** clause in this obscure case, as doing so may corrupt the outer Select
149933 static void havingToWhere(Parse *pParse, Select *p){
149965 Select *pS1;
150019 static int countOfViewOptimization(Parse *pParse, Select *p){
150020 Select *pSub, *pPrior;
150187 ** This routine does NOT free the Select structure passed in. The
150192 Select *p, /* The SELECT statement being coded. */
150322 Select *pSub = pItem->pSelect;
150538 Select *pSub;
152148 Select *pSelect, /* The SELECT statement */
152207 Select *pSelect, /* A SELECT statement that supplies values */
152588 Select *pSubquery;
152689 static int sqlite3ReturningSubqueryCorrelated(Walker *pWalker, Select *pSelect){
152747 Select sSelect;
152891 Select *pSelect = sqlite3SelectDup(db, pStep->pSelect, 0);
153472 Select *pSelect = 0;
157260 Select *pSelect; /* The entire SELECT statement containing WHERE */
157353 SQLITE_PRIVATE void sqlite3WhereAddLimit(WhereClause*, Select*);
157911 Select *pSelect; /* Pointer to the SELECT on the RHS */
161177 static Bitmask exprSelectUsage(WhereMaskSet *pMaskSet, Select *pS){
161855 SQLITE_PRIVATE void SQLITE_NOINLINE sqlite3WhereAddLimit(WhereClause *pWC, Select *p){
168350 Select *pSelect, /* The entire SELECT statement */
168582 Select sSelect;
170087 Select *pSubSelect; /* Current sub-select, if any */
170178 static int selectWindowRewriteSelectCb(Walker *pWalker, Select *pSelect){
170180 Select *pSave = p->pSubSelect;
170305 SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Select *p){
170314 Select *pSub = 0; /* The subquery */
170467 ** Unlink the Window object from the Select to which it is attached,
170682 SQLITE_PRIVATE void sqlite3WindowLink(Select *pSel, Window *pWin){
170738 SQLITE_PRIVATE void sqlite3WindowCodeInit(Parse *pParse, Select *pSelect){
172129 Select *p, /* Rewritten SELECT statement */
172565 static void parserDoubleLinkSelect(Parse *pParse, Select *p){
172568 Select *pNext = 0, *pLoop = p;
172593 /* Attach a With object describing the WITH clause to a Select
172596 static Select *attachWithToSelect(Parse *pParse, Select *pSelect, With *pWith){
172964 Select* yy555;
176419 Select *p = yymsp[0].minor.yy555;
176427 Select *pRhs = yymsp[0].minor.yy555;
176428 Select *pLhs = yymsp[-2].minor.yy555;
176594 Select *pSubquery;
176740 Select *pSubquery;
177096 Select *pSelectRHS = sqlite3ExprListToValues(pParse, nExpr, yymsp[-1].minor.yy14);
177126 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
201024 sqlite3_stmt *pSelect = 0; /* Select statement to read idx values */
202810 ** Select the fragment of text consisting of nFragment contiguous tokens
213214 ** Select a currently unused rowid for a new r-tree record.