1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

pgindent run.

This commit is contained in:
Bruce Momjian
2002-09-04 20:31:48 +00:00
parent c91ceec21d
commit e50f52a074
446 changed files with 14942 additions and 13363 deletions

View File

@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.55 2002/08/31 22:10:43 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.56 2002/09/04 20:31:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -128,7 +128,8 @@ expand_targetlist(List *tlist, int command_type,
/*
* The rewriter should have already ensured that the TLEs are in
* correct order; but we have to insert TLEs for any missing attributes.
* correct order; but we have to insert TLEs for any missing
* attributes.
*
* Scan the tuple description in the relation's relcache entry to make
* sure we have all the user attributes in the right order.
@@ -161,14 +162,14 @@ expand_targetlist(List *tlist, int command_type,
/*
* Didn't find a matching tlist entry, so make one.
*
* For INSERT, generate a NULL constant. (We assume the
* rewriter would have inserted any available default value.)
* Also, if the column isn't dropped, apply any domain constraints
* that might exist --- this is to catch domain NOT NULL.
* For INSERT, generate a NULL constant. (We assume the rewriter
* would have inserted any available default value.) Also, if
* the column isn't dropped, apply any domain constraints that
* might exist --- this is to catch domain NOT NULL.
*
* For UPDATE, generate a Var reference to the existing value of
* the attribute, so that it gets copied to the new tuple.
* But generate a NULL for dropped columns (we want to drop any
* the attribute, so that it gets copied to the new tuple. But
* generate a NULL for dropped columns (we want to drop any
* old values).
*/
Oid atttype = att_tup->atttypid;
@@ -181,13 +182,13 @@ expand_targetlist(List *tlist, int command_type,
new_expr = (Node *) makeConst(atttype,
att_tup->attlen,
(Datum) 0,
true, /* isnull */
true, /* isnull */
att_tup->attbyval,
false, /* not a set */
false, /* not a set */
false);
if (!att_tup->attisdropped)
new_expr = coerce_type_constraints(NULL, new_expr,
atttype, false);
atttype, false);
break;
case CMD_UPDATE:
/* Insert NULLs for dropped columns */
@@ -215,7 +216,7 @@ expand_targetlist(List *tlist, int command_type,
new_tle = makeTargetEntry(makeResdom(attrno,
atttype,
atttypmod,
pstrdup(NameStr(att_tup->attname)),
pstrdup(NameStr(att_tup->attname)),
false),
new_expr);
}

View File

@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.77 2002/09/02 02:47:02 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.78 2002/09/04 20:31:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -63,8 +63,8 @@ static List *generate_setop_tlist(List *colTypes, int flag,
List *input_tlist,
List *refnames_tlist);
static List *generate_append_tlist(List *colTypes, bool flag,
List *input_plans,
List *refnames_tlist);
List *input_plans,
List *refnames_tlist);
static Node *adjust_inherited_attrs_mutator(Node *node,
adjust_inherited_attrs_context *context);
@@ -172,8 +172,9 @@ recurse_set_operations(Node *setOp, Query *parse,
* This would fail if the Vars generated by generate_setop_tlist()
* were not exactly equal() to the corresponding tlist entries of
* the subplan. However, since the subplan was generated by
* generate_union_plan() or generate_nonunion_plan(), and hence its
* tlist was generated by generate_append_tlist(), this will work.
* generate_union_plan() or generate_nonunion_plan(), and hence
* its tlist was generated by generate_append_tlist(), this will
* work.
*/
if (flag >= 0 ||
!tlist_same_datatypes(plan->targetlist, colTypes, junkOK))
@@ -485,15 +486,15 @@ generate_append_tlist(List *colTypes, bool flag,
/*
* First extract typmods to use.
*
* If the inputs all agree on type and typmod of a particular column,
* use that typmod; else use -1.
* If the inputs all agree on type and typmod of a particular column, use
* that typmod; else use -1.
*/
colTypmods = (int32 *) palloc(length(colTypes) * sizeof(int32));
foreach(planl, input_plans)
{
Plan *subplan = (Plan *) lfirst(planl);
List *subtlist;
Plan *subplan = (Plan *) lfirst(planl);
List *subtlist;
curColType = colTypes;
colindex = 0;
@@ -796,8 +797,8 @@ adjust_inherited_attrs_mutator(Node *node,
var->varno = context->new_rt_index;
if (var->varattno > 0)
{
char *attname = get_attname(context->old_relid,
var->varattno);
char *attname = get_attname(context->old_relid,
var->varattno);
var->varattno = get_attnum(context->new_relid, attname);
if (var->varattno == InvalidAttrNumber)
@@ -819,10 +820,10 @@ adjust_inherited_attrs_mutator(Node *node,
if (IsA(node, JoinExpr))
{
/* Copy the JoinExpr node with correct mutation of subnodes */
JoinExpr *j;
JoinExpr *j;
j = (JoinExpr *) expression_tree_mutator(node,
adjust_inherited_attrs_mutator,
adjust_inherited_attrs_mutator,
(void *) context);
/* now fix JoinExpr's rtindex */
if (j->rtindex == context->old_rt_index)