Lines Matching full:clause
3165 ** or in an ORDER BY or GROUP BY clause.</dd>)^
3280 ** WHERE clause might influence the choice of query plan for a statement,
3284 ** ^The specific value of WHERE-clause [parameter] might influence the
3641 ** ^The name of a result column is the value of the "AS" clause for
3642 ** that column, if there is an AS clause. If there is no AS clause
5048 ** [ON CONFLICT | ON CONFLICT REPLACE] clause. ^Nor is the update hook
5465 ** ^(The aConstraint[] array records WHERE clause constraints of the form:
5478 ** and makes other simplifications to the WHERE clause in an attempt to
5479 ** get as many WHERE clause terms into the form shown above as possible.
5480 ** ^The aConstraint[] array only reports WHERE clause terms that are
5483 ** ^Information about the ORDER BY clause is stored in aOrderBy[].
5484 ** ^Each term of aOrderBy records a column of the ORDER BY clause.
5499 ** the correct order to satisfy the ORDER BY clause so that no separate
5527 } *aConstraint; /* Table of WHERE clause constraints */
5528 int nOrderBy; /* Number of terms in the ORDER BY clause */
5532 } *aOrderBy; /* The ORDER BY clause */
5552 ** an operator that is part of a constraint term in the wHERE clause of
7656 ** * Terms in the SET clause of an UPDATE statement
7659 ** * Terms in the VALUES clause of an INSERT statement
10935 ** sub-query that appears instead of a real table name in the FROM clause
11003 ** the table that contains the REFERENCES clause that creates the foreign
11004 ** key. The "to" table is the table that is named in the REFERENCES clause.
11018 ** Each REFERENCES clause generates an instance of the following structure
11028 Table *pFrom; /* Table containing the REFERENCES clause (aka: Child) */
11167 Expr *pPartIdxWhere; /* WHERE clause for partial indices */
11248 ExprList *pGroupBy; /* The group by clause */
11396 #define EP_FromJoin 0x000001 /* Originated in ON or USING clause of a join */
11542 ** The following structure describes the FROM clause of a SELECT statement.
11543 ** Each table or subquery in the FROM clause is a separate element of
11561 int nSrc; /* Number of tables or subqueries in the FROM clause */
11574 unsigned notIndexed :1; /* True if there is a NOT INDEXED clause */
11582 Expr *pOn; /* The ON clause of a join */
11583 IdList *pUsing; /* The USING clause of a join */
11585 char *zIndex; /* Identifier from "INDEXED BY <zIndex>" clause */
11616 #define WHERE_DISTINCTBY 0x0200 /* pOrderby is really a DISTINCT clause */
11632 ** be NULL. The pSrc corresponds to the FROM clause of a SELECT or
11673 ** nLimit is set to -1 if there is no LIMIT clause. nOffset is set to 0.
11674 ** If there is a LIMIT clause, the parser sets nLimit to the value of the
11687 ** sequences for the ORDER BY clause.
11696 SrcList *pSrc; /* The FROM clause */
11697 Expr *pWhere; /* The WHERE clause */
11698 ExprList *pGroupBy; /* The GROUP BY clause */
11699 Expr *pHaving; /* The HAVING clause */
11700 clause */
11705 With *pWith; /* WITH clause attached to this select. Or NULL. */
11719 #define SF_Values 0x0080 /* Synthesized from VALUES clause */
11721 #define SF_NestedFrom 0x0200 /* Part of a parenthesized FROM clause */
11744 ** All of the above are free to ignore their ORDER BY clause. Those that
11745 ** follow must honor the ORDER BY clause.
11776 ** the ORDER BY clause.
11800 /* The ORDER BY clause is ignored for all of the above */
11853 ** A Vdbe sub-program that implements the body and WHEN clause of trigger
11854 ** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of
12006 With *pWith; /* Current WITH clause, or NULL */
12062 Expr *pWhen; /* The WHEN clause of the expression (may be NULL) */
12107 * pWhere -> The WHERE clause of the DELETE statement if one is specified.
12112 * pWhere -> The WHERE clause of the UPDATE statement if one is specified.
12125 Expr *pWhere; /* The WHERE clause for DELETE or UPDATE steps */
12126 ExprList *pExprList; /* SET clause for UPDATE. */
12264 SrcList *pSrcList; /* FROM clause */
12286 ** (common table expressions) created by a single WITH clause.
12289 int nCte; /* Number of CTEs in the WITH clause */
12290 With *pOuter; /* Containing WITH clause, or NULL */
12291 struct Cte { /* For each CTE in the WITH clause.... */
67322 ** parameter in the WHERE clause might influence the choice of query plan
73108 ** that match the WHERE clause P4.
76723 ** FROM clause of SELECT statement p. Do not invoke the select
76724 ** callback on p, but do invoke it on each FROM clause subquery
76746 ** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
76750 ** the walk of the expressions and FROM clause. The xSelectCallback2()
76752 ** expressions and FROM clause.
76843 ** usable by indices within the WHERE clause processing logic.
76846 ** that in a GROUP BY clause, the expression is evaluated twice. Hence:
76854 ** The result of random()%5 in the GROUP BY clause is probably different
76856 ** not allow the GROUP BY clause to contain references to result-set columns.
76927 ** Return TRUE if the name zCol occurs anywhere in the USING clause.
76929 ** Return FALSE if the USING clause is NULL or if it does not contain
77093 ** USING clause, then skip this match.
77182 ** we are resolving names in the WHERE clause of the following command:
77189 ** resolved by the time the WHERE clause is resolved.
77193 ** clause is not standard SQL. This is a (goofy) SQLite extension, that
77333 ** clause.
77412 ** column in the FROM clause. This is used by the LIMIT and ORDER BY
77413 ** clause processing on UPDATE and DELETE statements.
77584 ** a SELECT statement. pE is a term in an ORDER BY or GROUP BY clause.
77635 Select *pSelect, /* The SELECT statement with the ORDER BY clause */
77692 ** Analyze the ORDER BY clause in a compound SELECT statement. Modify
77693 ** each term of the ORDER BY clause is a constant integer between 1
77721 sqlite3ErrorMsg(pParse, "too many terms in ORDER BY clause");
77761 ** taking care to preserve the COLLATE clause if it exists */
77793 ** Check every term in the ORDER BY or GROUP BY clause pOrderBy of
77804 Select *pSelect, /* The SELECT statement containing the clause */
77805 ExprList *pOrderBy, /* The ORDER BY or GROUP BY clause to be processed */
77816 sqlite3ErrorMsg(pParse, "too many terms in %s BY clause", zType);
77835 ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
77837 ** "ORDER" or "GROUP" depending on which type of clause pOrderBy is.
77839 ** This routine resolves each term of the clause into an expression.
77855 ExprList *pOrderBy, /* An ORDER BY or GROUP BY clause to resolve */
77860 struct ExprList_item *pItem; /* A term of the ORDER BY clause */
77918 ExprList *pGroupBy; /* The GROUP BY clause */
78017 /* If a HAVING clause is present, then there must be a GROUP BY clause.
78020 sqlite3ErrorMsg(pParse, "a GROUP BY clause is required before HAVING");
78026 ** expressions in the WHERE clause (etc.) can refer to expressions by
78042 /* Process the ORDER BY clause for singleton SELECT statements.
78043 ** The ORDER BY clause for compounds SELECT statements is handled
78054 /* Resolve the GROUP BY clause. At the same time, make sure
78055 ** the GROUP BY clause does not contain aggregate functions.
78066 "the GROUP BY clause");
78100 ** Y: The name of a table in a FROM clause. Or in a trigger
78115 ** size of an AS clause in the result-set of a SELECT. The Z expression
78179 ** subqueries in expressions, and subqueries used as FROM clause
78271 ** i.e. the WHERE clause expresssions in the following statements all
78317 Expr *pExpr, /* Add the "COLLATE" clause to this expression */
79536 ** an ON or USING clause.
79681 ** Where the SELECT... clause is as specified by the parameter to this
79699 assert( p->pGroupBy==0 ); /* Has no GROUP BY clause */
79700 if( p->pLimit ) return 0; /* Has no LIMIT clause */
79702 if( p->pWhere ) return 0; /* Has no WHERE clause */
79705 if( pSrc->nSrc!=1 ) return 0; /* Single term in FROM clause */
79709 assert( pTab->pSelect==0 ); /* FROM clause is not a view */
79710 if( IsVirtual(pTab) ) return 0; /* FROM clause not a virtual table */
79916 /* If no preexisting index is available for the IN clause
81262 clause */
82282 SrcList *pSrc; /* One particular FROM clause in a nested query */
82382 ** clause of the aggregate query */
82390 ** that is in the FROM clause of the aggregate query.
82906 ** that is not part of the temp-db schema, add a clause to the WHERE
83008 char *zWhere = 0; /* Where clause to locate temp triggers */
87730 ** has a WITHOUT ROWID clause. The job of this routine is to convert both
88214 ** to the elements of the FROM clause. But we do not want these changes
88738 ** clause is seen as part of a foreign key definition. The isDeferred
88902 Expr *pPIWhere, /* WHERE clause for partial indices */
89195 ** result of a PRIMARY KEY or UNIQUE clause on a column definition, or
89196 ** a PRIMARY KEY or UNIQUE clause following the column definitions.
89750 ** end of a growing FROM clause. The "p" parameter is the part of
89751 ** the FROM clause that has already been constructed. "p" is NULL
89752 ** if this is the first term of the FROM clause. pTable and pDatabase
89753 ** are the name of the table and database named in the FROM clause term.
89766 SrcList *p, /* The left part of the FROM clause already seen */
89767 Token *pTable, /* Name of the table to add to the FROM clause */
89771 Expr *pOn, /* The ON clause of a join */
89772 IdList *pUsing /* The USING clause of a join */
89777 sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s",
89805 ** Add an INDEXED BY or NOT INDEXED clause to the most recently added
89814 /* A "NOT INDEXED" clause was supplied. See parse.y
89824 ** When building up a FROM clause in the parser, the join operator
89828 ** clause.
90306 ** WITH clause.
90310 With *pWith, /* Existing WITH clause, or NULL */
90319 /* Check that the CTE name is unique within this WITH clause. If
90871 ** (as in the FROM clause of a SELECT statement) in this case it contains
90938 ** pWhere argument is an optional WHERE clause that restricts the
90944 Expr *pWhere, /* Optional WHERE clause to be added */
90979 SrcList *pSrc, /* the FROM clause -- which tables to scan */
90980 Expr *pWhere, /* The WHERE clause. May be null */
90981 ExprList *pOrderBy, /* The ORDER BY clause. May be null */
90982 Expr *pLimit, /* The LIMIT clause. May be null */
90983 Expr *pOffset, /* The OFFSET clause. May be null */
90993 /* Check that there isn't an ORDER BY without a LIMIT clause.
91023 /* duplicate the FROM clause as it is needed by both the DELETE/UPDATE tree
91036 /* now generate the new WHERE rowid IN clause for the DELETE/UDPATE */
91072 Expr *pWhere /* The WHERE clause. May be null */
91078 WhereInfo *pWInfo; /* Information about the WHERE clause */
91192 /* Resolve the column names in the WHERE clause.
91210 /* Special case: A DELETE without a WHERE clause deletes everything.
91250 ** to be deleted, based on the WHERE clause.
91328 ** where-clause loop above.
91614 ** A partial index should be skipped if its WHERE clause evaluates
93985 Expr *pWhere = 0; /* WHERE clause to scan with */
93986 NameContext sNameContext; /* Context used to resolve WHERE clause */
94027 ** to the WHERE clause that prevent this entry from being scanned.
94028 ** The added WHERE clause terms are like this:
94061 /* Resolve the references in the WHERE clause. */
94068 ** clause. If the constraint is not deferred, throw an exception for
94080 /* Clean up the WHERE clause constructed above. */
94570 Expr *pWhere = 0; /* WHERE clause of trigger step */
94574 Expr *pWhen = 0; /* WHEN clause for the trigger */
94608 /* For ON UPDATE, construct the next term of the WHEN clause.
94609 ** The final WHEN clause will be like this:
95163 ** insert with data coming from a VALUES clause, the code executes
95168 ** put VALUES clause expressions into registers
95176 ** If the SELECT clause is of the restricted form "SELECT * FROM <table2>" -
95197 ** and the SELECT clause does not read from <table> at any time.
95502 ** clause
96181 /* Skip partial indices for which the WHERE clause is not true */
96507 ** * The index has the exact same WHERE clause
96571 Table *pSrc; /* The table in the FROM clause of SELECT */
96606 assert(pSelect->pSrc); /* allocated even if there is no FROM clause */
96608 return 0; /* FROM clause must have exactly one term */
96611 return 0; /* FROM clause cannot contain a subquery */
96614 return 0; /* SELECT may not have a WHERE clause */
96617 return 0; /* SELECT may not have an ORDER BY clause */
96619 /* Do not need to test for a HAVING clause. If HAVING is present but
96622 return 0; /* SELECT may not have a GROUP BY clause */
96625 return 0; /* SELECT may not have a LIMIT clause */
96651 return 0; /* FROM clause does not contain a real table */
101501 ** the ORDER BY (or GROUP BY) clause of query is being coded.
101505 ExprList *pOrderBy; /* The ORDER BY (or GROUP BY clause) */
101551 SrcList *pSrc, /* the FROM clause -- which tables to scan */
101552 Expr *pWhere, /* the WHERE clause */
101553 ExprList *pGroupBy, /* the GROUP BY clause */
101554 Expr *pHaving, /* the HAVING clause */
101555 ExprList *pOrderBy, /* the ORDER BY clause */
101737 ** WHERE clause expression of a SELECT statement. The new term, which
101738 ** is ANDed with the existing WHERE clause, is of the form:
101748 SrcList *pSrc, /* List of tables in FROM clause */
101754 Expr **ppWhere /* IN/OUT: The WHERE clause to add to */
101786 ** join restriction specified in the ON or USING clause and not a part
101787 ** of the more general WHERE clause. These terms are moved over to the
101788 ** WHERE clause during join processing but we need to remember that they
101789 ** originated in the ON or USING clause.
101791 ** The Expr.iRightJoinTable tells the WHERE clause processing that the
101798 ** The where clause needs to defer the handling of the t1.x=5
101818 ** ON and USING clauses are converted into extra terms of the WHERE clause.
101819 ** NATURAL joins also create extra WHERE clause terms.
101821 ** The terms of a FROM clause are contained in the Select.pSrc structure.
101831 SrcList *pSrc; /* All tables in the FROM clause */
101847 /* When the NATURAL keyword is present, add WHERE clause terms for
101853 "an ON or USING clause", 0);
101877 /* Add the ON clause to the end of the WHERE clause, connected by
101886 /* Create extra terms on the WHERE clause for each column named
101887 ** in the USING clause. Example: If the two tables to be joined are
101888 ** A and B and the USING clause names X, Y, and Z, then add this
101889 ** to the WHERE clause: A.X=B.X AND A.Y=B.Y AND A.Z=B.Z
101890 ** Report an error if any column mentioned in the USING clause is
101896 char *zName; /* Name of the term in the USING clause */
101932 SortCtx *pSort, /* Information about the ORDER BY clause */
102271 ** does not matter. But there might be a LIMIT clause, in which
102288 /* The LIMIT clause will terminate the loop for us */
102302 /* The LIMIT clause will jump out of the loop for us */
102453 ** If the ExprList is an ORDER BY or GROUP BY clause then the resulting
102455 ** implement that clause. If the ExprList is the result set of a SELECT
102586 SortCtx *pSort, /* Information on the ORDER BY clause */
102659 /* The LIMIT clause will terminate the loop for us */
102795 /* The "table" is actually a sub-select or a view in the FROM clause
103286 ** with an ORDER BY clause. This function allocates and returns a KeyInfo
103332 ** There is exactly one reference to the recursive-table in the FROM clause
103352 ** If a LIMIT clause is provided, then the iteration stops after LIMIT rows
103354 ** negative LIMIT means to output all rows. If there is also an OFFSET clause
103364 SrcList *pSrc = p->pSrc; /* The FROM clause of the recursive query */
103378 ExprList *pOrderBy; /* The ORDER BY clause */
103433 /* Detach the ORDER BY clause from the compound SELECT */
103541 /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs. Only
103550 sqlite3ErrorMsg(pParse,"ORDER BY clause should come after %s not before",
103556 sqlite3ErrorMsg(pParse,"LIMIT clause should come after %s not before",
103595 /* Compound SELECTs that have an ORDER BY clause are handled separately.
103829 ** SELECT might also skip this part if it has no ORDER BY clause and
103930 /* Suppress the first OFFSET entries if there is an OFFSET clause
103975 /* The LIMIT clause will terminate the loop for us */
103987 /* The LIMIT clause will jump out of the loop for us */
104037 ** is an ORDER BY clause.
104044 ** is to code both <selectA> and <selectB> with the ORDER BY clause as
104157 ExprList *pOrderBy; /* The ORDER BY clause */
104158 int nOrderBy; /* Number of terms in the ORDER BY clause */
104174 /* Patch up the ORDER BY clause
104184 ** the ORDER BY clause covers every term of the result set. Add
104185 ** terms to the ORDER BY clause as necessary.
104208 ** collations to the ORDER BY clause terms so that when the subqueries
104225 /* Reattach the ORDER BY clause to the query.
104444 ** FROM clause of a SELECT such that the VDBE cursor assigned to that
104445 ** FORM clause entry is iTable. This routine make the necessary
104530 ** has no indices, the WHERE clause on the outer query cannot be
104561 ** (7) The subquery has a FROM clause. TODO: For subqueries without
104562 ** A FROM clause, consider adding a FROM close with the special
104584 ** subquery does not have a LIMIT clause.
104592 ** compound clause made up entirely of non-aggregate queries, and
104613 ** ORDER by clause
104617 ** have a WHERE clause.
104620 ** an ORDER BY clause. Ticket #3773. We could relax this constraint
104621 ** somewhat by saying that the terms of the ORDER BY clause must
104657 SrcList *pSrc; /* The FROM clause of the outer query */
104658 SrcList *pSubSrc; /* The FROM clause of the subquery */
104662 Expr *pWhere; /* The WHERE clause */
104725 ** join, make sure the subquery has no WHERE clause.
104793 ** SELECT <expr-list> FROM (<sub-query>) <where-clause>
104850 /* Begin flattening the iFrom-th entry of the FROM clause
104891 ** the FROM clause of the outer query. Before doing this, remember
104901 pSubSrc = pSub->pSrc; /* FROM clause of subquery */
104902 nSubSrc = pSubSrc->nSrc; /* Number of terms in subquery FROM clause */
104903 pSrc = pParent->pSrc; /* FROM clause of the outer query */
104917 /* The subquery uses a single slot of the FROM clause of the outer
104918 ** query. If the subquery has more than one element in its FROM clause,
104926 ** The outer query has 3 slots in its FROM clause. One slot of the
104930 ** two elements in the FROM clause of the subquery.
104939 /* Transfer the FROM clause terms from the subquery into the
105103 ** INDEXED BY clause, then try to locate the specified index. If there
105104 ** was such a clause and the named index cannot be found, return
105127 ** Detect compound SELECT statements that use an ORDER BY clause with
105138 ** above that generates the code for a compound SELECT with an ORDER BY clause
105140 ** result columns as on the ORDER BY clause. See ticket
105198 ** FROM clause element pItem is really a common-table-expression (CTE)
105206 With *pWith, /* Current outermost WITH clause */
105207 struct SrcList_item *pItem, /* FROM clause element to resolve */
105208 With **ppContext /* OUT: WITH clause return value belongs to */
105227 ** with the inner-most WITH clause being at the top of the stack.
105229 ** This routine pushes the WITH clause passed as the second argument
105231 ** WITH clause will never be popped from the stack. In this case it
105247 ** a WITH clause on the stack currently maintained by the parser. And,
105267 With *pWith; /* WITH clause that pCte belongs to */
105368 ** clause, pop it from the stack stored as part of the Parse object.
105372 ** names and other FROM clause elements.
105391 ** element of the FROM clause.
105394 ** defines FROM clause. When views appear in the FROM clause,
105401 ** (3) Add terms to the WHERE clause to accomodate the NATURAL keyword
105402 ** on joins and the ON and USING clause of joins.
105432 ** the FROM clause of the SELECT statement.
105436 /* Look up every table named in the FROM clause of the select. If
105437 ** an entry of the FROM clause is a subquery instead of a table or view,
105460 /* A sub-query in the FROM clause of a SELECT */
105475 /* An ordinary table or view name in the FROM clause */
105497 /* Locate the index named by the INDEXED BY clause, if any. */
105538 /* When processing FROM-clause subqueries, it is always the case
105620 /* In a join with a USING clause, omit columns in the
105621 ** using clause from the table on the right. */
105729 ** For each FROM-clause subquery, add Column.zType and Column.zColl
105752 /* A sub-query in the FROM clause of a SELECT */
105767 ** the Table structures of all FROM-clause subqueries in a
105788 ** * VDBE Cursor numbers are assigned to all FROM-clause terms.
105789 ** * Ephemeral Table objects are created for all FROM-clause subqueries.
106005 Expr *pWhere; /* The WHERE clause. May be NULL */
106006 ExprList *pGroupBy; /* The GROUP BY clause. May be NULL */
106007 Expr *pHaving; /* The HAVING clause. May be NULL */
106010 SortCtx sSort; /* Info on how to code the ORDER BY clause */
106067 /* Generate code for all sub-queries in the FROM clause
106079 ** once, if the subquery is part of the WHERE clause in a LEFT JOIN,
106214 /* If there is an ORDER BY clause, then this sorting
106264 /* No aggregate functions and no GROUP BY clause */
106301 /* This case when there exist aggregate functions or a GROUP BY clause
106317 ** GROUP BY clause.
106335 /* If there is both a GROUP BY and an ORDER BY clause and they are
106336 ** identical, then it may be possible to disable the ORDER BY clause
106380 KeyInfo *pKeyInfo; /* Keying information for the group by clause */
106390 /* If there is a GROUP BY clause we might need a sorting index to
106497 ** clause, cancel the ephemeral table open coded earlier.
106677 ** as if there was an "ORDER ON x" or "ORDER ON x DESC" clause.
106693 ** satisfying the 'ORDER BY' clause than it does in other cases.
106715 /* This case runs if the aggregate has no GROUP BY clause. The
106750 /* If there is an ORDER BY clause, then we need to sort the results
107166 Expr *pWhen, /* WHEN clause */
107506 ExprList *pEList, /* The SET clause: list of column and new values */
107507 Expr *pWhere, /* The WHERE clause */
107531 Expr *pWhere /* The WHERE clause */
107697 ** pEList is the SET clause of an UPDATE statement. Each entry
107954 /* If one was specified, code the WHEN clause. If it evaluates to false
108230 Expr *pWhere, /* WHERE clause of the UPDATE statement */
108240 ** The default value of a column is specified by a DEFAULT clause in the
108297 Expr *pWhere, /* The WHERE clause. May be null */
108303 WhereInfo *pWInfo; /* Information about the WHERE clause */
108543 ** WHERE clause.
108826 ** all record selected by the WHERE clause have been updated.
108911 Expr *pWhere, /* WHERE clause of the UPDATE statement */
110463 ** the WHERE clause of SQL statements. This module is responsible for
110519 ** loop in WHERE clause.
110527 ** each term in the FROM clause (which is to say, for each of the
110542 u8 iFrom; /* Which entry in the FROM clause */
110562 ** term of a join. Every term of the FROM clause will have at least
110565 ** FROM clause will have multiple WhereLoop objects, each describing a
110566 ** potential way of implementing that FROM-clause term, together with
110571 ** one WhereLoop object per FROM clause term, that satisfy all dependencies
110580 u8 iTab; /* Position in FROM clause of table for this loop */
110610 ** subquery on one operand of an OR operator in the WHERE clause.
110620 ** correspond to the subquery(s) of OR-clause processing. Only the
110648 ** number of nodes in the FROM clause. The best (lowest cost) WherePath
110663 ** help it analyze the subexpressions of the WHERE clause. Each WHERE
110664 ** clause subexpression is separated from the others by AND operators,
110689 ** is collected about the OR clause.
110691 ** If a term in the WHERE clause does not match either of the two previous
110725 WhereClause *pWC; /* The clause this term is part of */
110739 #define TERM_OR_OK 0x40 /* Used during OR-clause processing */
110748 ** terms in the WHERE clause that are useful to the query planner.
110764 ** WHERE clause. Mostly this is a container for one or more WhereTerms.
110766 ** Explanation of pOuter: For a WHERE clause of the form
110770 ** There are separate WhereClause objects for the whole clause and for
110772 ** subclauses points to the WhereClause object for the whole clause.
110775 WhereInfo *pWInfo; /* WHERE clause processing context */
110794 Bitmask indexable; /* Bitmask of all indexable tables in the clause */
110811 ** clause, the cursor numbers might not begin with 0 and they might
110820 ** For example, if the WHERE clause expression used these VDBE
110842 WhereClause *pWC; /* WHERE clause terms */
110843 ExprList *pOrderBy; /* ORDER BY clause */
110853 ** The WHERE clause processing routine has two halves. The
110865 ExprList *pOrderBy; /* The ORDER BY clause or NULL */
110883 WhereClause sWC; /* Decomposition of the WHERE clause */
110937 ** Return the estimated number of output rows from a WHERE clause
110945 ** WHERE clause returns outputs for DISTINCT processing.
110952 ** Return TRUE if the WHERE clause returns rows in ORDER BY order.
110961 ** immediately with the next row of a WHERE clause.
110978 ** the rowids returned by a WHERE clause. Return FALSE if doing an
110979 ** UPDATE or DELETE might change subsequent WHERE clause results.
110988 ** aiCur[0] and aiCur[1] both get -1 if the where-clause logic is
111154 ** This routine identifies subexpressions in the WHERE clause where
111163 ** The original WHERE clause in pExpr is unaltered. All this routine
111168 ** all terms of the WHERE clause.
111204 ** There is one cursor per table in the FROM clause. The number of
111205 ** tables in the FROM clause is limited by a test early in the
111270 ** allowed for an indexable WHERE clause term. The allowed operators are
111430 ** Initialize a WHERE clause scanner object. Return a pointer to the
111433 ** The scanner will be searching the WHERE clause pWC. It will look
111437 ** If the search is for X and the WHERE clause contains terms of the
111447 WhereClause *pWC, /* The WHERE clause to be scanned */
111478 ** Search for a term in the WHERE clause that is of the form "X <op> <expr>"
111484 ** the WHERE clause that specifies that X=Y. Any such constraints will be
111493 ** If there are multiple terms in the WHERE clause of the form "X <op> <expr>"
111501 WhereClause *pWC, /* The WHERE clause to be searched */
111529 ** Call exprAnalyze on all terms in a WHERE clause.
111532 SrcList *pTabList, /* the FROM clause */
111533 WhereClause *pWC /* the WHERE clause to be analyzed */
111668 ** If the pBase expression originated in the ON or USING clause of
111756 SrcList *pSrc, /* the FROM clause */
111757 WhereClause *pWC, /* the complete WHERE clause */
111760 WhereInfo *pWInfo = pWC->pWInfo; /* WHERE clause processing context */
111773 ** Break the OR clause into its separate subterms. The subterms are
111775 ** object that is attached to the original OR clause term.
111856 ** that there is no possibility of transforming the OR clause into an
111857 ** IN operator because one or more terms in the OR clause contain
111859 ** case means that every term of the OR clause is of the form
111866 ** the OR clause.
111919 ** table and column is common to every term in the OR clause */
111997 ** term of the form "Y <op> X" is added to the WHERE clause and
112005 SrcList *pSrc, /* the FROM clause */
112006 WhereClause *pWC, /* the WHERE clause */
112009 WhereInfo *pWInfo = pWC->pWInfo; /* WHERE clause processing context */
112048 extraRight = x-1; /* ON clause terms may not be used with an index
112300 /* Prevent ON clause terms of a LEFT JOIN from being used to drive
112348 SrcList *pTabList, /* The FROM clause */
112349 WhereClause *pWC, /* The WHERE clause */
112357 /* If there is more than one table or sub-select in the FROM clause of
112359 ** clause is redundant. */
112379 ** list, or else the WHERE clause contains a term of the form "col=X",
112383 ** 3. All of those index columns for which the WHERE clause does not
112461 ** Return TRUE if the WHERE clause term pTerm is of a form where it
112466 WhereTerm *pTerm, /* WHERE clause term to check */
112490 WhereClause *pWC, /* The WHERE clause */
112491 struct SrcList_item *pSrc, /* The FROM clause term to get the next index */
112496 WhereTerm *pTerm; /* A single term of the WHERE clause */
112521 ** and used to match WHERE clause constraints */
112661 /* Count the number of possible WHERE clause constraints referring
112674 /* If the ORDER BY clause contains only columns in the current
113027 ** bound, a lower bound, or both. The WHERE clause terms that set the upper
113315 ** Disable a term in the WHERE clause. Except, do not disable the term
113317 ** or USING clause of that join.
113326 ** in the ON clause. The term is disabled in (3) because it is not part
113394 ** Generate code for a single equality term of the WHERE clause. An equality
113406 WhereTerm *pTerm, /* The term of the WHERE clause to be coded */
113407 WhereLevel *pLevel, /* The level of the FROM clause we are working on */
113482 ** Suppose the WHERE clause is this: a==5 AND b IN (1,2,3) AND c>5 AND c<10
113494 ** The nExtraReg parameter is 0 or 1. It is 0 if all WHERE clause constraints
113792 ** Generate code for the start of the iLevel-th loop in the WHERE clause
113796 WhereInfo *pWInfo, /* Complete information about the WHERE clause */
113807 WhereClause *pWC; /* Decomposition of the entire WHERE clause */
113808 WhereTerm *pTerm; /* A WHERE clause term */
113812 struct SrcList_item *pTabItem; /* FROM clause term being coded */
113855 /* Special case of a FROM clause subquery implemented as a co-routine */
114026 ** The WHERE clause may contain zero or more equality
114051 ** This case is also used when there are no WHERE clause
114265 ** WHERE clause terms made redundant by the index range scan.
114328 WhereClause *pOrWc; /* The OR-clause broken out into subterms */
114329 SrcList *pOrTab; /* Shortened table list or OR-clause generation */
114340 u16 wctrlFlags; /* Flags for sub-WHERE clause */
114400 /* If the original WHERE clause is z of the form: (x1 OR x2 OR ...) AND y
114407 ** ON or USING clause of a LEFT JOIN, and terms that are usable as
114411 ** is not contained in the ON clause of a LEFT JOIN.
114432 /* Run a separate WHERE clause for each term of the OR clause. After
114434 ** sub-WHERE clause is to to invoke the main loop body as a subroutine.
114442 Expr *pOrExpr = pOrTerm->pExpr; /* Current OR clause term */
114457 /* This is the sub-WHERE clause body. First skip over
114613 ** Example: If the WHERE clause contains "t1.a=t2.b" and "t2.b=123"
114848 ** By "proper subset" we mean that X uses fewer WHERE clause terms
114849 ** than Y and that every WHERE clause term used by X is also used
114886 ** WHERE clause terms than Y and that every WHERE clause term used by X is
114891 ** clause terms covered, since some of the first nLTerm entries in aLTerm[]
115009 ** processing mode is used only for OR clause processing.
115117 ** WHERE clause that reference the loop but which are not used by an
115120 ** In the current implementation, the first extra WHERE clause term reduces
115172 struct SrcList_item *pSrc, /* FROM clause term being analyzed */
115222 /* Consider using a skip-scan if there are no WHERE clause constraints
115420 ** implementing the ORDER BY clause in pBuilder.
115422 ** Return False if pBuilder does not contain an ORDER BY clause or
115424 ** ORDER BY clause.
115503 ** WHERE clause includes "x IN (....)" terms used in place of "x=?". Or when
115515 WhereLoopBuilder *pBuilder, /* WHERE clause information */
115523 SrcList *pTabList; /* The FROM clause */
115524 struct SrcList_item *pSrc; /* The FROM clause btree term to add */
115531 WhereClause *pWC; /* The parsed WHERE clause */
115543 /* An INDEXED BY clause specifies a particular index to use */
115548 /* There is no INDEXED BY clause. Create a fake Index object in local
115566 ** NOT INDEXED qualifier is omitted from the FROM clause */
115693 /* If there was an INDEXED BY clause, then only that one index is
115706 WhereLoopBuilder *pBuilder, /* WHERE clause information */
115711 WhereClause *pWC; /* The WHERE clause */
115712 struct SrcList_item *pSrc; /* The FROM clause term to search */
115833 /* A virtual table that is constrained by an IN clause may not
115834 ** consume the ORDER BY clause because (1) the order of IN terms
116024 ** N>0: N terms of the ORDER BY clause are satisfied
116025 ** N==0: No terms of the ORDER BY clause are satisfied
116037 WhereInfo *pWInfo, /* The WHERE clause */
116038 ExprList *pOrderBy, /* ORDER BY or GROUP BY or DISTINCT clause to check */
116050 u8 isMatch; /* iColumn matches a term of the ORDER BY clause */
116053 u16 nOrderBy; /* Number terms in the ORDER BY clause */
116059 WhereTerm *pTerm; /* A single term of the WHERE clause */
116060 Expr *pOBExpr; /* An expression from the ORDER BY clause */
116061 CollSeq *pColl; /* COLLATE function from an ORDER BY clause term */
116078 ** that WhereLoop that are in the ORDER BY clause are different for every
116080 ** order-distinct. A WhereLoop that has no columns in the ORDER BY clause
116087 ** rowid appears in the ORDER BY clause, the corresponding WhereLoop is
116112 ** clause of the form X IS NULL or X=? that reference only outer
116217 /* Make sure the sort order is compatible in an ORDER BY clause.
116218 ** Sort order is irrelevant for a GROUP BY clause. */
116279 ** BY clause - and so any order that groups rows as required satisfies the
116333 ** Or, if the order-by clause has X terms but only the last Y
116376 int nOrderBy; /* Number of ORDER BY clause terms */
116400 /* If nRowEst is zero and there is an ORDER BY clause, ignore it. In this
116424 /* If there is an ORDER BY clause and it is not being ignored, set up
116428 ** the ORDER BY clause are already in order, where X is the array
116785 ** Generate the beginning of the loop used for WHERE clause processing.
116789 ** in order to complete the WHERE clause processing.
116794 ** the FROM clause of a select. (INSERT and UPDATE statements are the
116795 ** same as a SELECT with only a single table in the FROM clause.) For
116811 ** appear in the FROM clause if a different order is better able to make
116813 ** the WHERE clause, it might result in additional nested loops for
116826 ** If the WHERE clause is empty, the foreach loops must each scan their
116828 ** the tables have indices and there are terms in the WHERE clause that
116833 ** Terms of the WHERE clause are also used to limit which rows actually
116835 ** terms of the WHERE clause that use only terms in that loop and outer
116857 ** ORDER BY CLAUSE PROCESSING
116859 ** pOrderBy is a pointer to the ORDER BY clause (or the GROUP BY clause
116861 ** if there is one. If there is no ORDER BY clause or if this routine
116866 ** to use for OR clause processing. The WHERE clause should use this
116874 SrcList *pTabList, /* FROM clause: A list of all tables to be scanned */
116875 Expr *pWhere, /* The WHERE clause */
116876 ExprList *pOrderBy, /* An ORDER BY (or GROUP BY) clause, or NULL */
116899 /* An ORDER/GROUP BY clause of more than 63 terms cannot be optimized */
116910 /* The number of tables in the FROM clause is limited by the number of
116959 /* Split the WHERE clause into separate subexpressions where each
116966 /* Special case: a WHERE clause that is constant. Evaluate the
116977 /* Special case: No FROM clause
116986 /* Assign a bit from the bitmask to every term in the FROM clause.
116988 ** When assigning bitmask values to FROM clause cursors, it must be
116989 ** the case that if X is the bitmask for the N-th FROM clause term then
116990 ** the bitmask for all FROM clause terms to the left of the N-th term
116991 ** is (X-1). An expression from the ON clause of a LEFT JOIN can use
117017 ** add new virtual terms onto the end of the WHERE clause. We do not
117039 /* Display all terms of the WHERE clause */
117150 ** The one-pass algorithm only works if the WHERE clause constrains
117497 ** LIMIT clause of a SELECT statement.
120586 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
120593 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
126343 ** the tokenizer clause of the CREATE VIRTUAL TABLE statement to the
126347 ** be used for the fts3 table (customized by the tokenizer clause arguments).
126368 ** arguments passed to the "tokenizer" clause of the CREATE VIRTUAL
127651 ** Return a list of comma separated SQL expressions and a FROM clause that
132083 ** (as "b" is part of a non-matching NEAR clause).
132813 ** xBestIndex - Analyze a WHERE and ORDER BY clause.
136300 ** When queried, the query must include a WHERE clause of type:
136506 ** xBestIndex - Analyze a WHERE and ORDER BY clause.
136778 ** if a query has a LIMIT clause).