}
final public TableOperatorNode qualifiedJoin(ResultSetNode leftRSN, boolean nestedInParens) throws ParseException, StandardException {
int joinType = JoinNode.INNERJOIN;
ResultSetNode rightRSN;
TableOperatorNode ton = null;
Object[] onOrUsingClause = null;
ResultColumnList usingClause = null;
ValueNode onClause;
switch (jj_nt.kind) {
case INNER:
case LEFT:
case RIGHT:
joinType = joinType();
break;
default:
jj_la1[193] = jj_gen;
;
}
jj_consume_token(JOIN);
rightRSN = tableReferenceTypes(nestedInParens);
onOrUsingClause = joinSpecification(leftRSN, rightRSN);
/* If NATURAL OR UNION is specified, then no joinSpecification()
* is required, otherwise it is required.
*/
/* RESOLVE - Since we don't support NATURAL or UNION joins yet,
* onOrUsingClause must be non-null. (Change error message if and
* when grammar changes.)
*/
/* Figure out whether an ON or USING clause was used */
onClause = (ValueNode) onOrUsingClause[ON_CLAUSE];
usingClause = (ResultColumnList) onOrUsingClause[USING_CLAUSE];
if (onClause == null && usingClause == null)
{
{if (true) throw StandardException.newException(SQLState.LANG_MISSING_JOIN_SPECIFICATION,
JoinNode.joinTypeToString(joinType));}
}
switch(joinType)
{
case JoinNode.INNERJOIN:
ton = (TableOperatorNode) nodeFactory.getNode(
C_NodeTypes.JOIN_NODE,
leftRSN,
rightRSN,
onClause,
usingClause,
null,
null,
null,
getContextManager());
break;
case JoinNode.LEFTOUTERJOIN:
ton = (TableOperatorNode) nodeFactory.getNode(
C_NodeTypes.HALF_OUTER_JOIN_NODE,
leftRSN,
rightRSN,
onClause,
usingClause,
Boolean.FALSE,
null,
getContextManager());
break;
case JoinNode.RIGHTOUTERJOIN:
ton = (TableOperatorNode) nodeFactory.getNode(
C_NodeTypes.HALF_OUTER_JOIN_NODE,
leftRSN,
rightRSN,
onClause,
usingClause,
Boolean.TRUE,
null,
getContextManager());
break;
default:
if (SanityManager.DEBUG)
{
SanityManager.ASSERT(false, "Unexpected joinType");
}
{if (true) return null;}
}
/* Mark whether or not we are nested within parens */
ton.setNestedInParens(nestedInParens);
{if (true) return ton;}
throw new Error("Missing return statement in function");
}