diff options
Diffstat (limited to 'src/backend/parser/analyze.c')
-rw-r--r-- | src/backend/parser/analyze.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 027cb972ee7..1576613bc1a 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -17,7 +17,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.401 2010/02/12 22:48:56 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.402 2010/02/26 02:00:49 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -53,7 +53,7 @@ static Query *transformSetOperationStmt(ParseState *pstate, SelectStmt *stmt); static Node *transformSetOperationTree(ParseState *pstate, SelectStmt *stmt, bool isTopLevel, List **colInfo); static void determineRecursiveColTypes(ParseState *pstate, - Node *larg, List *lcolinfo); + Node *larg, List *lcolinfo); static void applyColumnNames(List *dst, List *src); static Query *transformUpdateStmt(ParseState *pstate, UpdateStmt *stmt); static List *transformReturningList(ParseState *pstate, List *returningList); @@ -62,7 +62,7 @@ static Query *transformDeclareCursorStmt(ParseState *pstate, static Query *transformExplainStmt(ParseState *pstate, ExplainStmt *stmt); static void transformLockingClause(ParseState *pstate, Query *qry, - LockingClause *lc, bool pushedDown); + LockingClause *lc, bool pushedDown); /* @@ -823,14 +823,14 @@ transformSelectStmt(ParseState *pstate, SelectStmt *stmt) qry->sortClause = transformSortClause(pstate, stmt->sortClause, &qry->targetList, - true /* fix unknowns */, - false /* allow SQL92 rules */); + true /* fix unknowns */ , + false /* allow SQL92 rules */ ); qry->groupClause = transformGroupClause(pstate, stmt->groupClause, &qry->targetList, qry->sortClause, - false /* allow SQL92 rules */); + false /* allow SQL92 rules */ ); if (stmt->distinctClause == NIL) { @@ -1040,8 +1040,8 @@ transformValuesClause(ParseState *pstate, SelectStmt *stmt) qry->sortClause = transformSortClause(pstate, stmt->sortClause, &qry->targetList, - true /* fix unknowns */, - false /* allow SQL92 rules */); + true /* fix unknowns */ , + false /* allow SQL92 rules */ ); qry->limitOffset = transformLimitClause(pstate, stmt->limitOffset, "OFFSET"); @@ -1294,8 +1294,8 @@ transformSetOperationStmt(ParseState *pstate, SelectStmt *stmt) qry->sortClause = transformSortClause(pstate, sortClause, &qry->targetList, - false /* no unknowns expected */, - false /* allow SQL92 rules */); + false /* no unknowns expected */ , + false /* allow SQL92 rules */ ); pstate->p_rtable = list_truncate(pstate->p_rtable, sv_rtable_length); pstate->p_relnamespace = sv_relnamespace; @@ -1494,8 +1494,8 @@ transformSetOperationTree(ParseState *pstate, SelectStmt *stmt, &lcolinfo); /* - * If we are processing a recursive union query, now is the time - * to examine the non-recursive term's output columns and mark the + * If we are processing a recursive union query, now is the time to + * examine the non-recursive term's output columns and mark the * containing CTE as having those result columns. We should do this * only at the topmost setop of the CTE, of course. */ @@ -1552,25 +1552,25 @@ transformSetOperationTree(ParseState *pstate, SelectStmt *stmt, rescoltypmod = -1; /* - * Verify the coercions are actually possible. If not, we'd - * fail later anyway, but we want to fail now while we have - * sufficient context to produce an error cursor position. + * Verify the coercions are actually possible. If not, we'd fail + * later anyway, but we want to fail now while we have sufficient + * context to produce an error cursor position. * * The if-tests might look wrong, but they are correct: we should * verify if the input is non-UNKNOWN *or* if it is an UNKNOWN * Const (to verify the literal is valid for the target data type) * or Param (to possibly resolve the Param's type). We should do * nothing if the input is say an UNKNOWN Var, which can happen in - * some cases. The planner is sometimes able to fold the Var to a + * some cases. The planner is sometimes able to fold the Var to a * constant before it has to coerce the type, so failing now would * just break cases that might work. */ if (lcoltype != UNKNOWNOID || - IsA(lcolnode, Const) || IsA(lcolnode, Param)) + IsA(lcolnode, Const) ||IsA(lcolnode, Param)) (void) coerce_to_common_type(pstate, lcolnode, rescoltype, context); if (rcoltype != UNKNOWNOID || - IsA(rcolnode, Const) || IsA(rcolnode, Param)) + IsA(rcolnode, Const) ||IsA(rcolnode, Param)) (void) coerce_to_common_type(pstate, rcolnode, rescoltype, context); @@ -1647,8 +1647,8 @@ determineRecursiveColTypes(ParseState *pstate, Node *larg, List *lcolinfo) Assert(leftmostQuery != NULL); /* - * Generate dummy targetlist using column names of leftmost select - * and dummy result expressions of the non-recursive term. + * Generate dummy targetlist using column names of leftmost select and + * dummy result expressions of the non-recursive term. */ targetList = NIL; left_tlist = list_head(leftmostQuery->targetList); @@ -2095,12 +2095,13 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc, case RTE_SUBQUERY: applyLockingClause(qry, i, lc->forUpdate, lc->noWait, pushedDown); + /* * FOR UPDATE/SHARE of subquery is propagated to all of - * subquery's rels, too. We could do this later (based - * on the marking of the subquery RTE) but it is convenient - * to have local knowledge in each query level about - * which rels need to be opened with RowShareLock. + * subquery's rels, too. We could do this later (based on + * the marking of the subquery RTE) but it is convenient + * to have local knowledge in each query level about which + * rels need to be opened with RowShareLock. */ transformLockingClause(pstate, rte->subquery, allrels, true); |