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

pgindent run on all C files. Java run to follow. initdb/regression

tests pass.
This commit is contained in:
Bruce Momjian
2001-10-25 05:50:21 +00:00
parent 59da2105d8
commit b81844b173
818 changed files with 21684 additions and 20491 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.88 2001/07/31 20:16:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.89 2001/10/25 05:49:34 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -354,7 +354,6 @@ make_ands_explicit(List *andclauses)
List *
make_ands_implicit(Expr *clause)
{
/*
* NB: because the parser sets the qual field to NULL in a query that
* has no WHERE clause, we must consider a NULL input clause as TRUE,
@@ -526,7 +525,6 @@ void
check_subplans_for_ungrouped_vars(Node *clause,
Query *query)
{
/*
* No special setup needed; context for walker is just the Query
* pointer
@@ -555,7 +553,6 @@ check_subplans_for_ungrouped_vars_walker(Node *node,
*/
if (is_subplan(node))
{
/*
* The args list of the subplan node represents attributes from
* outside passed into the sublink.
@@ -686,7 +683,6 @@ contain_noncachable_functions_walker(Node *node, void *context)
bool
is_pseudo_constant_clause(Node *clause)
{
/*
* We could implement this check in one recursive scan. But since the
* check for noncachable functions is both moderately expensive and
@@ -746,7 +742,7 @@ pull_constant_clauses(List *quals, List **constantQual)
static bool
sortgroupref_is_present(Index sortgroupref, List *clauselist)
{
List *clause;
List *clause;
foreach(clause, clauselist)
{
@@ -765,20 +761,21 @@ sortgroupref_is_present(Index sortgroupref, List *clauselist)
bool
has_distinct_on_clause(Query *query)
{
List *targetList;
List *targetList;
/* Is there a DISTINCT clause at all? */
if (query->distinctClause == NIL)
return false;
/*
* If the DISTINCT list contains all the nonjunk targetlist items,
* and nothing else (ie, no junk tlist items), then it's a simple
* If the DISTINCT list contains all the nonjunk targetlist items, and
* nothing else (ie, no junk tlist items), then it's a simple
* DISTINCT, else it's DISTINCT ON. We do not require the lists to be
* in the same order (since the parser may have adjusted the DISTINCT
* clause ordering to agree with ORDER BY). Furthermore, a non-DISTINCT
* junk tlist item that is in the sortClause is also evidence of
* DISTINCT ON, since we don't allow ORDER BY on junk tlist items when
* plain DISTINCT is used.
* clause ordering to agree with ORDER BY). Furthermore, a
* non-DISTINCT junk tlist item that is in the sortClause is also
* evidence of DISTINCT ON, since we don't allow ORDER BY on junk
* tlist items when plain DISTINCT is used.
*
* This code assumes that the DISTINCT list is valid, ie, all its entries
* match some entry of the tlist.
@@ -1155,7 +1152,6 @@ eval_const_expressions_mutator(Node *node, void *context)
}
if (IsA(node, RelabelType))
{
/*
* If we can simplify the input to a constant, then we don't need
* the RelabelType node anymore: just change the type field of the
@@ -1272,7 +1268,6 @@ eval_const_expressions_mutator(Node *node, void *context)
}
if (IsA(node, Iter))
{
/*
* The argument of an Iter is normally a function call. We must
* not try to eliminate the function, but we can try to simplify
@@ -1423,7 +1418,6 @@ simplify_op_or_func(Expr *expr, List *args)
*/
if (proisstrict && has_null_input)
{
/*
* It's strict and has NULL input, so must produce NULL output.
* Return a NULL constant of the right type.
@@ -1871,7 +1865,6 @@ expression_tree_mutator(Node *node,
Node *(*mutator) (),
void *context)
{
/*
* The mutator has already decided not to modify the current node, but
* we must call the mutator for any sub-nodes.
@@ -1933,7 +1926,6 @@ expression_tree_mutator(Node *node,
}
else
{
/*
* for other Expr node types, just transform args
* list, linking to original oper node (OK?)
@@ -2026,8 +2018,8 @@ expression_tree_mutator(Node *node,
break;
case T_NullTest:
{
NullTest *ntest = (NullTest *) node;
NullTest *newnode;
NullTest *ntest = (NullTest *) node;
NullTest *newnode;
FLATCOPY(newnode, ntest, NullTest);
MUTATE(newnode->arg, ntest->arg, Node *);
@@ -2046,7 +2038,6 @@ expression_tree_mutator(Node *node,
break;
case T_SubLink:
{
/*
* A "bare" SubLink (note we will not come here if we
* found a SUBPLAN_EXPR node above it). Transform the
@@ -2062,7 +2053,6 @@ expression_tree_mutator(Node *node,
break;
case T_List:
{
/*
* We assume the mutator isn't interested in the list
* nodes per se, so just invoke it on each list element.
@@ -2083,7 +2073,6 @@ expression_tree_mutator(Node *node,
break;
case T_TargetEntry:
{
/*
* We mutate the expression, but not the resdom, by
* default.

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.29 2001/03/22 03:59:39 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.30 2001/10/25 05:49:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -59,7 +59,7 @@ joininfo_member(List *join_relids, List *joininfo_list)
* Returns a joininfo node.
*
*/
JoinInfo *
JoinInfo *
find_joininfo_node(RelOptInfo *this_rel, Relids join_relids)
{
JoinInfo *joininfo = joininfo_member(join_relids,

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.75 2001/07/16 05:06:58 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.76 2001/10/25 05:49:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -325,7 +325,7 @@ create_seqscan_path(Query *root, RelOptInfo *rel)
*
* Returns the new path node.
*/
IndexPath *
IndexPath *
create_index_path(Query *root,
RelOptInfo *rel,
IndexOptInfo *index,
@@ -363,8 +363,8 @@ create_index_path(Query *root,
pathnode->rows = rel->rows;
/*
* Not sure if this is necessary, but it should help if the
* statistics are too far off
* Not sure if this is necessary, but it should help if the statistics
* are too far off
*/
if (index->indpred && index->tuples < pathnode->rows)
pathnode->rows = index->tuples;

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.68 2001/08/21 16:36:03 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.69 2001/10/25 05:49:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -115,8 +115,8 @@ find_secondary_indexes(Oid relationObjectId)
info = makeNode(IndexOptInfo);
/*
* Need to make these arrays large enough to be sure there is
* room for a terminating 0 at the end of each one.
* Need to make these arrays large enough to be sure there is room
* for a terminating 0 at the end of each one.
*/
info->classlist = (Oid *) palloc(sizeof(Oid) * (INDEX_MAX_KEYS + 1));
info->indexkeys = (int *) palloc(sizeof(int) * (INDEX_MAX_KEYS + 1));
@@ -125,7 +125,7 @@ find_secondary_indexes(Oid relationObjectId)
/* Extract info from the pg_index tuple */
info->indexoid = index->indexrelid;
info->indproc = index->indproc; /* functional index ?? */
if (VARSIZE(&index->indpred) > VARHDRSZ) /* partial index ?? */
if (VARSIZE(&index->indpred) > VARHDRSZ) /* partial index ?? */
{
char *predString;
@@ -210,7 +210,7 @@ find_secondary_indexes(Oid relationObjectId)
* This code executes registered procedures stored in the
* operator relation, by calling the function manager.
*
* varRelid is either 0 or a rangetable index. See clause_selectivity()
* varRelid is either 0 or a rangetable index. See clause_selectivity()
* for details about its meaning.
*/
Selectivity
@@ -223,8 +223,8 @@ restriction_selectivity(Query *root,
float8 result;
/*
* if the oprrest procedure is missing for whatever reason,
* use a selectivity of 0.5
* if the oprrest procedure is missing for whatever reason, use a
* selectivity of 0.5
*/
if (!oprrest)
return (Selectivity) 0.5;
@@ -257,8 +257,8 @@ join_selectivity(Query *root,
float8 result;
/*
* if the oprjoin procedure is missing for whatever reason,
* use a selectivity of 0.5
* if the oprjoin procedure is missing for whatever reason, use a
* selectivity of 0.5
*/
if (!oprjoin)
return (Selectivity) 0.5;
@@ -365,10 +365,10 @@ has_unique_index(RelOptInfo *rel, AttrNumber attno)
IndexOptInfo *index = (IndexOptInfo *) lfirst(ilist);
/*
* Note: ignore functional and partial indexes, since they
* don't allow us to conclude that all attr values are distinct.
* Also, a multicolumn unique index doesn't allow us to conclude
* that just the specified attr is unique.
* Note: ignore functional and partial indexes, since they don't
* allow us to conclude that all attr values are distinct. Also, a
* multicolumn unique index doesn't allow us to conclude that just
* the specified attr is unique.
*/
if (index->unique &&
index->nkeys == 1 &&

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.34 2001/10/18 16:11:42 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.35 2001/10/25 05:49:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -26,9 +26,9 @@
static RelOptInfo *make_base_rel(Query *root, int relid);
static List *new_join_tlist(List *tlist, int first_resdomno);
static List *build_joinrel_restrictlist(Query *root,
RelOptInfo *joinrel,
RelOptInfo *outer_rel,
RelOptInfo *inner_rel);
RelOptInfo *joinrel,
RelOptInfo *outer_rel,
RelOptInfo *inner_rel);
static void build_joinrel_joinlist(RelOptInfo *joinrel,
RelOptInfo *outer_rel,
RelOptInfo *inner_rel);
@@ -154,7 +154,7 @@ make_base_rel(Query *root, int relid)
if (relationObjectId != InvalidOid)
{
/* Plain relation --- retrieve statistics from the system catalogs */
bool indexed;
bool indexed;
get_relation_info(relationObjectId,
&indexed, &rel->pages, &rel->tuples);
@@ -270,7 +270,6 @@ build_join_rel(Query *root,
if (joinrel)
{
/*
* Yes, so we only need to figure the restrictlist for this
* particular pair of component relations.
@@ -437,9 +436,9 @@ build_joinrel_restrictlist(Query *root,
RelOptInfo *outer_rel,
RelOptInfo *inner_rel)
{
List *result = NIL;
List *rlist;
List *item;
List *result = NIL;
List *rlist;
List *item;
/*
* Collect all the clauses that syntactically belong at this level.
@@ -453,9 +452,9 @@ build_joinrel_restrictlist(Query *root,
* Eliminate duplicate and redundant clauses.
*
* We must eliminate duplicates, since we will see many of the same
* clauses arriving from both input relations. Also, if a clause is
* a mergejoinable clause, it's possible that it is redundant with
* previous clauses (see optimizer/README for discussion). We detect
* clauses arriving from both input relations. Also, if a clause is a
* mergejoinable clause, it's possible that it is redundant with
* previous clauses (see optimizer/README for discussion). We detect
* that case and omit the redundant clause from the result list.
*
* We can detect redundant mergejoinable clauses very cheaply by using
@@ -463,8 +462,9 @@ build_joinrel_restrictlist(Query *root,
* equijoined variables in question. All the members of a pathkey set
* that are in the left relation have already been forced to be equal;
* likewise for those in the right relation. So, we need to have only
* one clause that checks equality between any set member on the left and
* any member on the right; by transitivity, all the rest are then equal.
* one clause that checks equality between any set member on the left
* and any member on the right; by transitivity, all the rest are then
* equal.
*/
foreach(item, rlist)
{
@@ -477,8 +477,8 @@ build_joinrel_restrictlist(Query *root,
/* check for redundant merge clauses */
if (rinfo->mergejoinoperator != InvalidOid)
{
bool redundant = false;
List *olditem;
bool redundant = false;
List *olditem;
cache_mergeclause_pathkeys(root, rinfo);

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.50 2001/03/22 03:59:40 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.51 2001/10/25 05:49:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -60,7 +60,6 @@ matching_tlist_expr(Node *node, List *targetlist)
return (Node *) NULL;
}
#endif
/*

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.32 2001/05/09 23:13:35 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.33 2001/10/25 05:49:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -41,7 +41,7 @@ typedef struct
static bool pull_varnos_walker(Node *node,
pull_varnos_context *context);
static bool contain_var_reference_walker(Node *node,
contain_var_reference_context *context);
contain_var_reference_context *context);
static bool contain_var_clause_walker(Node *node, void *context);
static bool pull_var_clause_walker(Node *node,
pull_var_clause_context *context);
@@ -55,7 +55,7 @@ static bool pull_var_clause_walker(Node *node,
*
* NOTE: this is used on not-yet-planned expressions. It may therefore find
* bare SubLinks, and if so it needs to recurse into them to look for uplevel
* references to the desired rtable level! But when we find a completed
* references to the desired rtable level! But when we find a completed
* SubPlan, we only need to look at the parameters passed to the subplan.
*/
List *
@@ -96,7 +96,6 @@ pull_varnos_walker(Node *node, pull_varnos_context *context)
}
if (is_subplan(node))
{
/*
* Already-planned subquery. Examine the args list (parameters to
* be passed to subquery), as well as the "oper" list which is
@@ -137,7 +136,7 @@ pull_varnos_walker(Node *node, pull_varnos_context *context)
*
* NOTE: this is used on not-yet-planned expressions. It may therefore find
* bare SubLinks, and if so it needs to recurse into them to look for uplevel
* references to the desired rtable entry! But when we find a completed
* references to the desired rtable entry! But when we find a completed
* SubPlan, we only need to look at the parameters passed to the subplan.
*/
bool
@@ -180,7 +179,6 @@ contain_var_reference_walker(Node *node,
}
if (is_subplan(node))
{
/*
* Already-planned subquery. Examine the args list (parameters to
* be passed to subquery), as well as the "oper" list which is