Lines Matching refs:JOIN

17258 #define SQLITE_SimplifyJoin   0x00002000 /* Convert LEFT JOIN to JOIN */
18664 #define JT_LTORJ 0x40 /* One of the LEFT operands of a RIGHT JOIN
18689 #define WHERE_RIGHT_JOIN 0x1000 /* Processing a RIGHT JOIN */
19121 u8 withinRJSubrtn; /* Nesting level for RIGHT JOIN body subroutines */
31532 sqlite3_str_appendf(&x, " FULL-OUTER-JOIN");
31534 sqlite3_str_appendf(&x, " LEFT-JOIN");
31536 sqlite3_str_appendf(&x, " RIGHT-JOIN");
31538 sqlite3_str_appendf(&x, " CROSS-JOIN");
103859 ** iColumn. Append this new expression term to the FULL JOIN Match set
103927 ExprList *pFJMatch = 0; /* Matches for FULL JOIN .. USING */
103984 ** .... FROM t1 LEFT JOIN (t2 RIGHT JOIN t3 USING(x)) USING(y) ...
104008 /* An INNER or LEFT JOIN. Use the left-most table */
104012 /* A RIGHT JOIN. Use the right-most table */
104017 /* For a FULL JOIN, we must construct a coalesce() func */
104064 /* An INNER or LEFT JOIN. Use the left-most table */
104068 /* A RIGHT JOIN. Use the right-most table */
104073 /* For a FULL JOIN, we must construct a coalesce() func */
104341 ** be multiple matches for a NATURAL LEFT JOIN or a LEFT JOIN USING.
108094 ** of a LEFT JOIN, and
108128 ** (3) pSrc cannot be part of the left operand for a RIGHT JOIN.
108131 ** (4) If pSrc is the right operand of a LEFT JOIN, then...
108133 (4b) and specifically the ON clause associated with the LEFT JOIN.
108135 ** (5) If pSrc is not the right operand of a LEFT JOIN or the left
108136 ** operand of a RIGHT JOIN, then pExpr must be from the WHERE
110534 ** that derive from the right-hand table of a LEFT JOIN. The
110537 ** on a LEFT JOIN NULL row.
110561 ** of a LEFT JOIN. */
111765 ** This routine is used to check if a LEFT JOIN can be converted into
111766 ** an ordinary JOIN. The p argument is the WHERE clause. If the WHERE
111767 ** clause requires that some column of the right table of the LEFT JOIN
111768 ** be non-NULL, then the LEFT JOIN can be safely converted into an
122427 sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s",
122553 ** * All tables to the left of the right-most RIGHT JOIN are tagged with
122556 ** the left operand of at least one RIGHT JOIN.
122568 /* All terms to the left of a RIGHT JOIN should be tagged with the
138403 ** Given 1 to 3 identifiers preceding the JOIN keyword, determine the
138446 ** INNER CROSS JOIN -> same as JOIN
138447 ** NATURAL CROSS JOIN -> same as NATURAL JOIN
138448 ** OUTER LEFT JOIN -> same as LEFT JOIN
138449 ** LEFT NATURAL JOIN -> same as NATURAL LEFT JOIN
138450 ** LEFT RIGHT JOIN -> same as FULL JOIN
138451 ** RIGHT OUTER FULL JOIN -> same as FULL JOIN
138452 ** CROSS CROSS CROSS JOIN -> same as JOIN
138597 ** the OUTER JOIN processing logic that this term is part of the
138608 ** SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5
138638 /* Undo the work of sqlite3SetJoinExpr(). This is used when a LEFT JOIN
138639 ** is simplified into an ordinary JOIN, and when an ON expression is
138648 ** if the table that p references is on the left side of a RIGHT JOIN.
138787 ** JOIN. But older versions of SQLite do not do that, so we avoid
141975 ** position in the parent that NULL-able due to an OUTER JOIN. Either the
141976 ** target slot in the parent is the right operand of a LEFT JOIN, or one of
141977 ** the left operands of a RIGHT JOIN. In either case, we need to potentially
141993 ** SELECT a,b,m,x FROM t1 LEFT JOIN (SELECT 59 AS m,x FROM t2) ON b=x;
141995 ** When the subquery on the right side of the LEFT JOIN is flattened, we
142343 ** (3) If the subquery is the right operand of a LEFT JOIN then
142350 ** See also (26) for restrictions on RIGHT JOIN.
142401 ** (17f) the subquery must not be the RHS of a LEFT JOIN.
142454 ** (26) The subquery may not be the right operand of a RIGHT JOIN.
142455 ** See also (3) for restrictions on LEFT JOIN.
142457 ** (27) The subquery may not contain a FULL or RIGHT JOIN unless it
142460 ** (27b) the subquery is a compound query and the RIGHT JOIN occurs
142490 int isOuterJoin = 0; /* True if pSub is the right side of a LEFT JOIN */
142544 ** If the subquery is the right operand of a LEFT JOIN, then the
142548 ** t1 LEFT OUTER JOIN (t2 JOIN t3)
142552 ** (t1 LEFT OUTER JOIN t2) JOIN t3
143099 ** part of a ON clause from a LEFT JOIN, then throughout the query
143164 ** RIGHT JOIN anywhere in the query */
143167 /* Do not propagate constants through the ON clause of a LEFT JOIN */
143246 ** (4) The inner query is the right operand of a LEFT JOIN and the
143248 ** on that LEFT JOIN.
143251 ** of a LEFT JOIN where iCursor is not the right-hand table of that
143256 ** JOIN (SELECT 1 AS b2 UNION ALL SELECT 2) AS bb ON (a1=b2)
143257 ** LEFT JOIN (SELECT 8 AS c3 UNION ALL SELECT 9) AS cc ON (b2=2);
145036 /* Convert LEFT JOIN into JOIN if there are terms of the right table
145037 ** of the LEFT JOIN used in the WHERE clause.
145044 ("LEFT-JOIN simplifies to JOIN on term %d\n",i));
145276 ** (3) the subquery is not part of a left operand for a RIGHT JOIN
151354 ** Extra information attached to a WhereLevel that is a RIGHT JOIN.
151380 int iLeftJoin; /* Memory cell used to implement LEFT OUTER JOIN */
151396 WhereRightJoin *pRJ; /* Extra information for RIGHT JOIN */
152134 sqlite3_str_appendf(&str, " LEFT-JOIN");
152235 ** if it controls a LEFT OUTER JOIN and it did not originate in the ON
152240 ** (1) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x WHERE t2.z='ok'
152241 ** (2) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x AND t2.z='ok'
152246 ** of a LEFT OUTER JOIN. In (1), the term is not disabled.
152867 ** of a LEFT JOIN. Set Walker.eCode to non-zero before returning if the
152978 ** JOIN for which the current table is not the rhs are omitted
152981 ** If this table is the rhs of a LEFT JOIN, "IS" or "IS NULL" terms
152985 ** SELECT ... t1 LEFT JOIN t2 ON (t1.a=t2.b) WHERE t2.c IS NULL;
153304 /* If this is the right table of a LEFT OUTER JOIN, allocate and
153314 VdbeComment((v, "init LEFT JOIN no-match flag"));
153978 ** for a LEFT JOIN.
153987 ** a LEFT JOIN: */
154105 ** is required in a few obscure LEFT JOIN cases where control jumps
154132 ** ON or USING clause of a LEFT JOIN, and terms that are usable as
154136 ** is not contained in the ON clause of a LEFT JOIN.
154505 /* For a RIGHT OUTER JOIN, record the fact that the current row has
154515 /* pTab is the right-hand table of the RIGHT JOIN. Generate code that
154546 /* For a LEFT OUTER JOIN, generate code that will record the fact that
154552 VdbeComment((v, "record LEFT JOIN hit"));
154560 ** of the RIGHT JOIN. During normal operation, the subroutine will
154573 ** to the results of the OUTER JOIN. The following loop generates the
154608 ** for a RIGHT JOIN.
154627 ExplainQueryPlan((pParse, 1, "RIGHT-JOIN %s", pTabItem->pTab->zName));
155601 ** 3. Not originating in the ON clause of an OUTER JOIN
155756 Bitmask extraRight = 0; /* Extra dependencies on LEFT JOIN */
155813 ** on left table of a LEFT JOIN. Ticket #3015 */
155819 /* The ON clause of an INNER JOIN references a table to its right.
155823 ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite
156194 /* Prevent ON clause terms of a LEFT JOIN from being used to drive
157306 ** the right table of a RIGHT JOIN because the constraint implies a
157307 ** not-NULL condition on the left table of the RIGHT JOIN.
159202 ** operand, or if the loop is not an OUTER JOIN.
159994 && (pSrc->fg.jointype & JT_RIGHT)==0 /* Not the right tab of a RIGHT JOIN */
160160 /* Do not do an SCAN of a index-on-expression in a RIGHT JOIN
160524 ** If there are no LEFT or CROSS JOIN joins in the query, both mPrereq and
160527 ** separated from it by at least one LEFT or CROSS JOIN. Similarly, the
160530 ** CROSS JOIN.
160534 ** ... FROM t1, t2 LEFT JOIN t3, t4, vt CROSS JOIN t5, t6;
160699 /* The multi-index OR optimization does not work for RIGHT and FULL JOIN */
160840 ** prevents the right operand of a RIGHT JOIN from being swapped with
160845 ** a LEFT JOIN over to the left side of that join if the LEFT JOIN
160846 ** is itself on the left side of a RIGHT JOIN.
161872 ** 2) The table must be the RHS of a LEFT JOIN.
161888 ** LEFT JOIN t2 ON (t1.ipk=t2.ipk)
161889 ** LEFT JOIN t3 ON (t1.ipk=t3.ipk)
161894 ** LEFT JOIN t2
161895 ** LEFT JOIN t3 ON (t1.ipk=t3.ipk)
162694 /* The nature of RIGHT JOIN processing is such that it messes up
162696 ** optimizations. We need to do an actual sort for RIGHT JOIN. */
162824 ** the RIGHT JOIN table */
162892 /* For LEFT JOIN queries, cursor pIn->iCur may not have been
162982 /* Do RIGHT JOIN processing. Generate code that will output the
162983 ** unmatched rows of the right operand of the RIGHT JOIN with
167597 0, /* JOIN => nothing */
167870 /* 143 */ "JOIN",
168175 /* 122 */ "joinop ::= COMMA|JOIN",
168176 /* 123 */ "joinop ::= JOIN_KW JOIN",
168177 /* 124 */ "joinop ::= JOIN_KW nm JOIN",
168178 /* 125 */ "joinop ::= JOIN_KW nm nm JOIN",
169086 258, /* (122) joinop ::= COMMA|JOIN */
169087 258, /* (123) joinop ::= JOIN_KW JOIN */
169088 258, /* (124) joinop ::= JOIN_KW nm JOIN */
169089 258, /* (125) joinop ::= JOIN_KW nm nm JOIN */
169496 -1, /* (122) joinop ::= COMMA|JOIN */
169497 -2, /* (123) joinop ::= JOIN_KW JOIN */
169498 -3, /* (124) joinop ::= JOIN_KW nm JOIN */
169499 -4, /* (125) joinop ::= JOIN_KW nm nm JOIN */
170349 case 122: /* joinop ::= COMMA|JOIN */
170352 case 123: /* joinop ::= JOIN_KW JOIN */
170355 case 124: /* joinop ::= JOIN_KW nm JOIN */
170358 case 125: /* joinop ::= JOIN_KW nm nm JOIN */
172092 ** 103: JOIN ISNULL OFFSET
172223 testcase( i==82 ); /* JOIN */