mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Cleanup of source files where 'return' or 'var =' is alone on a line.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.35 1999/02/03 20:15:37 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.36 1999/02/03 21:16:30 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -396,11 +396,9 @@ create_indexscan_node(IndexPath *best_path,
|
||||
(List *) copyObject(lfirst(indxqual)));
|
||||
}
|
||||
|
||||
fixed_indxqual =
|
||||
(List *) fix_indxqual_references((Node *) indxqual, (Path *) best_path);
|
||||
fixed_indxqual = (List *) fix_indxqual_references((Node *) indxqual, (Path *) best_path);
|
||||
|
||||
scan_node =
|
||||
make_indexscan(tlist,
|
||||
scan_node = make_indexscan(tlist,
|
||||
qpqual,
|
||||
lfirsti(best_path->path.parent->relids),
|
||||
best_path->indexid,
|
||||
@@ -470,12 +468,10 @@ create_nestloop_node(JoinPath *best_path,
|
||||
List *new_inner_qual = NIL;
|
||||
|
||||
clauses = set_difference(clauses, inner_indxqual); /* XXX */
|
||||
new_inner_qual =
|
||||
index_outerjoin_references(inner_indxqual,
|
||||
new_inner_qual = index_outerjoin_references(inner_indxqual,
|
||||
outer_node->targetlist,
|
||||
((Scan *) inner_node)->scanrelid);
|
||||
((IndexScan *) inner_node)->indxqual =
|
||||
lcons(new_inner_qual, NIL);
|
||||
((IndexScan *) inner_node)->indxqual = lcons(new_inner_qual, NIL);
|
||||
}
|
||||
}
|
||||
else if (IsA_Join(inner_node))
|
||||
@@ -533,17 +529,14 @@ create_mergejoin_node(MergePath *best_path,
|
||||
outer_tlist,
|
||||
inner_tlist));
|
||||
|
||||
opcode =
|
||||
get_opcode((best_path->jpath.path.p_ordering.ord.merge)->join_operator);
|
||||
opcode = get_opcode((best_path->jpath.path.p_ordering.ord.merge)->join_operator);
|
||||
|
||||
outer_order = (Oid *) palloc(sizeof(Oid) * 2);
|
||||
outer_order[0] =
|
||||
(best_path->jpath.path.p_ordering.ord.merge)->left_operator;
|
||||
outer_order[0] = (best_path->jpath.path.p_ordering.ord.merge)->left_operator;
|
||||
outer_order[1] = 0;
|
||||
|
||||
inner_order = (Oid *) palloc(sizeof(Oid) * 2);
|
||||
inner_order[0] =
|
||||
(best_path->jpath.path.p_ordering.ord.merge)->right_operator;
|
||||
inner_order[0] = (best_path->jpath.path.p_ordering.ord.merge)->right_operator;
|
||||
inner_order[1] = 0;
|
||||
|
||||
/*
|
||||
@@ -615,8 +608,7 @@ create_hashjoin_node(HashPath *best_path,
|
||||
* Separate the hashclauses from the other join qualification clauses
|
||||
* and set those clauses to contain references to lower attributes.
|
||||
*/
|
||||
qpqual =
|
||||
join_references(set_difference(clauses,
|
||||
qpqual = join_references(set_difference(clauses,
|
||||
best_path->path_hashclauses),
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
@@ -625,8 +617,7 @@ create_hashjoin_node(HashPath *best_path,
|
||||
* Now set the references in the hashclauses and rearrange them so
|
||||
* that the outer variable is always on the left.
|
||||
*/
|
||||
hashclauses =
|
||||
switch_outer(join_references(best_path->path_hashclauses,
|
||||
hashclauses = switch_outer(join_references(best_path->path_hashclauses,
|
||||
outer_tlist,
|
||||
inner_tlist));
|
||||
|
||||
@@ -690,8 +681,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
|
||||
is_funcclause((Node *) get_leftop((Expr *) clause)) &&
|
||||
((Func *) ((Expr *) get_leftop((Expr *) clause))->oper)->funcisindex)
|
||||
{
|
||||
Var *newvar =
|
||||
makeVar((Index) lfirsti(index_path->parent->relids),
|
||||
Var *newvar = makeVar((Index) lfirsti(index_path->parent->relids),
|
||||
1, /* func indices have one key */
|
||||
((Func *) ((Expr *) clause)->oper)->functype,
|
||||
-1,
|
||||
@@ -699,8 +689,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
|
||||
(Index) lfirsti(index_path->parent->relids),
|
||||
0);
|
||||
|
||||
return
|
||||
((Node *) make_opclause((Oper *) ((Expr *) clause)->oper,
|
||||
return ((Node *) make_opclause((Oper *) ((Expr *) clause)->oper,
|
||||
newvar,
|
||||
get_rightop((Expr *) clause)));
|
||||
|
||||
@@ -716,8 +705,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
|
||||
{
|
||||
subclause = lfirst(i);
|
||||
if (subclause)
|
||||
new_subclauses =
|
||||
lappend(new_subclauses,
|
||||
new_subclauses = lappend(new_subclauses,
|
||||
fix_indxqual_references(subclause,
|
||||
index_path));
|
||||
|
||||
@@ -751,8 +739,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
|
||||
{
|
||||
subclause = lfirst(i);
|
||||
if (subclause)
|
||||
new_subclauses =
|
||||
lappend(new_subclauses,
|
||||
new_subclauses = lappend(new_subclauses,
|
||||
fix_indxqual_references(subclause,
|
||||
index_path));
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.21 1999/02/03 20:15:38 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.22 1999/02/03 21:16:35 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -208,8 +208,7 @@ add_clause_to_rels(Query *root, List *clause)
|
||||
}
|
||||
else
|
||||
{
|
||||
restrictinfo->selectivity =
|
||||
compute_clause_selec(root, (Node *) clause, NIL);
|
||||
restrictinfo->selectivity = compute_clause_selec(root, (Node *) clause, NIL);
|
||||
}
|
||||
rel->restrictinfo = lcons(restrictinfo, rel->restrictinfo);
|
||||
}
|
||||
@@ -232,8 +231,7 @@ add_clause_to_rels(Query *root, List *clause)
|
||||
}
|
||||
else
|
||||
{
|
||||
restrictinfo->selectivity =
|
||||
compute_clause_selec(root, (Node *) clause, NIL);
|
||||
restrictinfo->selectivity = compute_clause_selec(root, (Node *) clause, NIL);
|
||||
}
|
||||
add_join_info_to_rels(root, restrictinfo, relids);
|
||||
/* we are going to be doing a join, so add var to targetlist */
|
||||
@@ -272,8 +270,7 @@ add_join_info_to_rels(Query *root, RestrictInfo * restrictinfo, List *join_relid
|
||||
|
||||
joininfo = find_joininfo_node(get_base_rel(root, lfirsti(join_relid)),
|
||||
other_rels);
|
||||
joininfo->jinfo_restrictinfo =
|
||||
lcons(copyObject((void *) restrictinfo), joininfo->jinfo_restrictinfo);
|
||||
joininfo->jinfo_restrictinfo = lcons(copyObject((void *) restrictinfo), joininfo->jinfo_restrictinfo);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.41 1999/02/03 20:15:39 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.42 1999/02/03 21:16:36 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -124,8 +124,7 @@ union_planner(Query *parse)
|
||||
parse->resultRelation,
|
||||
parse->rtable);
|
||||
}
|
||||
else if ((rt_index =
|
||||
first_inherit_rt_entry(rangetable)) != -1)
|
||||
else if ((rt_index = first_inherit_rt_entry(rangetable)) != -1)
|
||||
{
|
||||
if (parse->rowMark != NULL)
|
||||
elog(ERROR, "SELECT FOR UPDATE is not supported for inherit queries");
|
||||
@@ -263,8 +262,7 @@ union_planner(Query *parse)
|
||||
* get the varno/attno entries to the appropriate references to
|
||||
* the result tuple of the subplans.
|
||||
*/
|
||||
((Agg *) result_plan)->aggs =
|
||||
get_agg_tlist_references((Agg *) result_plan);
|
||||
((Agg *) result_plan)->aggs = get_agg_tlist_references((Agg *) result_plan);
|
||||
|
||||
/***S*H***/
|
||||
if(parse->havingQual!=NULL)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.36 1999/02/03 20:15:39 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.37 1999/02/03 21:16:38 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -150,8 +150,7 @@ set_tempscan_tlist_references(SeqScan *tempscan)
|
||||
{
|
||||
Temp *temp = (Temp *) ((Plan *) tempscan)->lefttree;
|
||||
|
||||
((Plan *) tempscan)->targetlist =
|
||||
tlist_temp_references(temp->tempid,
|
||||
((Plan *) tempscan)->targetlist = tlist_temp_references(temp->tempid,
|
||||
((Plan *) tempscan)->targetlist);
|
||||
set_temp_tlist_references(temp);
|
||||
}
|
||||
@@ -175,8 +174,7 @@ set_temp_tlist_references(Temp *temp)
|
||||
if (source != NULL)
|
||||
{
|
||||
set_tlist_references(source);
|
||||
((Plan *) temp)->targetlist =
|
||||
copy_vars(((Plan *) temp)->targetlist,
|
||||
((Plan *) temp)->targetlist = copy_vars(((Plan *) temp)->targetlist,
|
||||
(source)->targetlist);
|
||||
}
|
||||
else
|
||||
@@ -307,8 +305,7 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
return (List *) clause;
|
||||
else if (and_clause((Node *) clause))
|
||||
{
|
||||
List *andclause =
|
||||
replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
List *andclause = replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
|
||||
@@ -316,8 +313,7 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
}
|
||||
else if (or_clause((Node *) clause))
|
||||
{
|
||||
List *orclause =
|
||||
replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
List *orclause = replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
|
||||
@@ -351,8 +347,7 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
}
|
||||
else if (is_funcclause((Node *) clause))
|
||||
{
|
||||
List *funcclause =
|
||||
replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
List *funcclause = replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
|
||||
@@ -361,8 +356,7 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
}
|
||||
else if (not_clause((Node *) clause))
|
||||
{
|
||||
List *notclause =
|
||||
replace_clause_joinvar_refs(get_notclausearg(clause),
|
||||
List *notclause = replace_clause_joinvar_refs(get_notclausearg(clause),
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
|
||||
@@ -370,12 +364,10 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
}
|
||||
else if (is_opclause((Node *) clause))
|
||||
{
|
||||
Var *leftvar =
|
||||
(Var *) replace_clause_joinvar_refs((Expr *) get_leftop(clause),
|
||||
Var *leftvar = (Var *) replace_clause_joinvar_refs((Expr *) get_leftop(clause),
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
Var *rightvar =
|
||||
(Var *) replace_clause_joinvar_refs((Expr *) get_rightop(clause),
|
||||
Var *rightvar = (Var *) replace_clause_joinvar_refs((Expr *) get_rightop(clause),
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
|
||||
@@ -385,8 +377,7 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
}
|
||||
else if (is_subplan(clause))
|
||||
{
|
||||
((Expr *) clause)->args =
|
||||
replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
((Expr *) clause)->args = replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
((SubPlan *) ((Expr *) clause)->oper)->sublink->oper =
|
||||
@@ -965,8 +956,7 @@ check_having_qual_for_vars(Node *clause, List *targetlist_so_far)
|
||||
}
|
||||
else if (IsA(clause, Aggref))
|
||||
{
|
||||
targetlist_so_far =
|
||||
check_having_qual_for_vars(((Aggref *) clause)->target, targetlist_so_far);
|
||||
targetlist_so_far = check_having_qual_for_vars(((Aggref *) clause)->target, targetlist_so_far);
|
||||
return targetlist_so_far;
|
||||
}
|
||||
else if (IsA(clause, ArrayRef))
|
||||
|
||||
@@ -340,8 +340,7 @@ SS_replace_correlation_vars(Node *expr)
|
||||
}
|
||||
else if (IsA(expr, Iter))
|
||||
{
|
||||
((Iter *) expr)->iterexpr =
|
||||
SS_replace_correlation_vars(((Iter *) expr)->iterexpr);
|
||||
((Iter *) expr)->iterexpr = SS_replace_correlation_vars(((Iter *) expr)->iterexpr);
|
||||
}
|
||||
else if (single_node(expr))
|
||||
return expr;
|
||||
@@ -350,22 +349,18 @@ SS_replace_correlation_vars(Node *expr)
|
||||
((Expr *) expr)->args = (List *)
|
||||
SS_replace_correlation_vars((Node *) ((Expr *) expr)->args);
|
||||
else if (IsA(expr, Aggref))
|
||||
((Aggref *) expr)->target =
|
||||
SS_replace_correlation_vars((Node *) ((Aggref *) expr)->target);
|
||||
((Aggref *) expr)->target = SS_replace_correlation_vars((Node *) ((Aggref *) expr)->target);
|
||||
else if (IsA(expr, ArrayRef))
|
||||
{
|
||||
((ArrayRef *) expr)->refupperindexpr = (List *)
|
||||
SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->refupperindexpr);
|
||||
((ArrayRef *) expr)->reflowerindexpr = (List *)
|
||||
SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->reflowerindexpr);
|
||||
((ArrayRef *) expr)->refexpr =
|
||||
SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->refexpr);
|
||||
((ArrayRef *) expr)->refassgnexpr =
|
||||
SS_replace_correlation_vars(((ArrayRef *) expr)->refassgnexpr);
|
||||
((ArrayRef *) expr)->refexpr = SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->refexpr);
|
||||
((ArrayRef *) expr)->refassgnexpr = SS_replace_correlation_vars(((ArrayRef *) expr)->refassgnexpr);
|
||||
}
|
||||
else if (IsA(expr, TargetEntry))
|
||||
((TargetEntry *) expr)->expr =
|
||||
SS_replace_correlation_vars((Node *) ((TargetEntry *) expr)->expr);
|
||||
((TargetEntry *) expr)->expr = SS_replace_correlation_vars((Node *) ((TargetEntry *) expr)->expr);
|
||||
else if (IsA(expr, SubLink))
|
||||
{
|
||||
List *le;
|
||||
|
||||
Reference in New Issue
Block a user