1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Phase 2 of pgindent updates.

Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.

Commit e3860ffa4d wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code.  The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there.  BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs.  So the
net result is that in about half the cases, such comments are placed
one tab stop left of before.  This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.

Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.

This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.

Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2017-06-21 15:18:54 -04:00
parent f669c09989
commit c7b8998ebb
1107 changed files with 3433 additions and 3514 deletions

View File

@ -121,4 +121,4 @@ cx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring,
return num_diffs;
}
#endif /* defined(CX) */
#endif /* defined(CX) */

View File

@ -468,4 +468,4 @@ edge_failure(PlannerInfo *root, Gene *gene, int index, Edge *edge_table, int num
return 0; /* to keep the compiler quiet */
}
#endif /* defined(ERX) */
#endif /* defined(ERX) */

View File

@ -129,4 +129,4 @@ print_edge_table(FILE *fp, Edge *edge_table, int num_gene)
fflush(fp);
}
#endif /* GEQO_DEBUG */
#endif /* GEQO_DEBUG */

View File

@ -63,4 +63,4 @@ geqo_mutation(PlannerInfo *root, Gene *tour, int num_gene)
}
}
#endif /* defined(CX) */
#endif /* defined(CX) */

View File

@ -92,4 +92,4 @@ ox1(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene,
}
#endif /* defined(OX1) */
#endif /* defined(OX1) */

View File

@ -109,4 +109,4 @@ ox2(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene,
}
#endif /* defined(OX2) */
#endif /* defined(OX2) */

View File

@ -221,4 +221,4 @@ pmx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene)
pfree(check_list);
}
#endif /* defined(PMX) */
#endif /* defined(PMX) */

View File

@ -54,7 +54,7 @@ alloc_pool(PlannerInfo *root, int pool_size, int string_length)
new_pool->data = (Chromosome *) palloc(pool_size * sizeof(Chromosome));
/* all gene */
chromo = (Chromosome *) new_pool->data; /* vector of all chromos */
chromo = (Chromosome *) new_pool->data; /* vector of all chromos */
for (i = 0; i < pool_size; i++)
chromo[i].string = palloc((string_length + 1) * sizeof(Gene));

View File

@ -107,4 +107,4 @@ px(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene,
}
#endif /* defined(PX) */
#endif /* defined(PX) */

View File

@ -89,4 +89,4 @@ free_city_table(PlannerInfo *root, City *city_table)
pfree(city_table);
}
#endif /* CX || PX || OX1 || OX2 */
#endif /* CX || PX || OX1 || OX2 */

View File

@ -159,7 +159,7 @@ make_one_rel(PlannerInfo *root, List *joinlist)
if (brel == NULL)
continue;
Assert(brel->relid == rti); /* sanity check on array */
Assert(brel->relid == rti); /* sanity check on array */
/* ignore RTEs that are "other rels" */
if (brel->reloptkind != RELOPT_BASEREL)
@ -258,7 +258,7 @@ set_base_rel_sizes(PlannerInfo *root)
if (rel == NULL)
continue;
Assert(rel->relid == rti); /* sanity check on array */
Assert(rel->relid == rti); /* sanity check on array */
/* ignore RTEs that are "other rels" */
if (rel->reloptkind != RELOPT_BASEREL)
@ -300,7 +300,7 @@ set_base_rel_pathlists(PlannerInfo *root)
if (rel == NULL)
continue;
Assert(rel->relid == rti); /* sanity check on array */
Assert(rel->relid == rti); /* sanity check on array */
/* ignore RTEs that are "other rels" */
if (rel->reloptkind != RELOPT_BASEREL)
@ -3442,4 +3442,4 @@ debug_print_rel(PlannerInfo *root, RelOptInfo *rel)
fflush(stdout);
}
#endif /* OPTIMIZER_DEBUG */
#endif /* OPTIMIZER_DEBUG */

View File

@ -31,7 +31,7 @@
*/
typedef struct RangeQueryClause
{
struct RangeQueryClause *next; /* next in linked list */
struct RangeQueryClause *next; /* next in linked list */
Node *var; /* The common variable of the clauses */
bool have_lobound; /* found a low-bound clause yet? */
bool have_hibound; /* found a high-bound clause yet? */
@ -848,7 +848,7 @@ clause_selectivity(PlannerInfo *root,
#ifdef SELECTIVITY_DEBUG
elog(DEBUG4, "clause_selectivity: s1 %f", s1);
#endif /* SELECTIVITY_DEBUG */
#endif /* SELECTIVITY_DEBUG */
return s1;
}

View File

@ -2963,7 +2963,7 @@ initial_cost_hashjoin(PlannerInfo *root, JoinCostWorkspace *workspace,
*/
ExecChooseHashTableSize(inner_path_rows,
inner_path->pathtarget->width,
true, /* useskew */
true, /* useskew */
&numbuckets,
&numbatches,
&num_skew_mcvs);
@ -4047,7 +4047,7 @@ get_parameterized_baserel_size(PlannerInfo *root, RelOptInfo *rel,
nrows = rel->tuples *
clauselist_selectivity(root,
allclauses,
rel->relid, /* do not use 0! */
rel->relid, /* do not use 0! */
JOIN_INNER,
NULL);
nrows = clamp_row_est(nrows);

View File

@ -244,7 +244,7 @@ process_equivalence(PlannerInfo *root, RestrictInfo *restrictinfo,
{
EquivalenceMember *cur_em = (EquivalenceMember *) lfirst(lc2);
Assert(!cur_em->em_is_child); /* no children yet */
Assert(!cur_em->em_is_child); /* no children yet */
/*
* If below an outer join, don't match constants: they're not as
@ -1704,7 +1704,7 @@ reconsider_outer_join_clause(PlannerInfo *root, RestrictInfo *rinfo,
{
EquivalenceMember *cur_em = (EquivalenceMember *) lfirst(lc2);
Assert(!cur_em->em_is_child); /* no children yet */
Assert(!cur_em->em_is_child); /* no children yet */
if (equal(outervar, cur_em->em_expr))
{
match = true;
@ -1834,7 +1834,7 @@ reconsider_full_join_clause(PlannerInfo *root, RestrictInfo *rinfo)
foreach(lc2, cur_ec->ec_members)
{
coal_em = (EquivalenceMember *) lfirst(lc2);
Assert(!coal_em->em_is_child); /* no children yet */
Assert(!coal_em->em_is_child); /* no children yet */
if (IsA(coal_em->em_expr, CoalesceExpr))
{
CoalesceExpr *cexpr = (CoalesceExpr *) coal_em->em_expr;
@ -1997,7 +1997,7 @@ match_eclasses_to_foreign_key_col(PlannerInfo *root,
Index var2varno = fkinfo->ref_relid;
AttrNumber var2attno = fkinfo->confkey[colno];
Oid eqop = fkinfo->conpfeqop[colno];
List *opfamilies = NIL; /* compute only if needed */
List *opfamilies = NIL; /* compute only if needed */
ListCell *lc1;
foreach(lc1, root->eq_classes)

View File

@ -1170,7 +1170,7 @@ build_paths_for_OR(PlannerInfo *root, RelOptInfo *rel,
List *clauses, List *other_clauses)
{
List *result = NIL;
List *all_clauses = NIL; /* not computed till needed */
List *all_clauses = NIL; /* not computed till needed */
ListCell *lc;
foreach(lc, rel->indexlist)
@ -1383,7 +1383,7 @@ choose_bitmap_and(PlannerInfo *root, RelOptInfo *rel, List *paths)
Assert(npaths > 0); /* else caller error */
if (npaths == 1)
return (Path *) linitial(paths); /* easy case */
return (Path *) linitial(paths); /* easy case */
/*
* In theory we should consider every nonempty subset of the given paths.
@ -1650,7 +1650,7 @@ bitmap_and_cost_est(PlannerInfo *root, RelOptInfo *rel, List *paths)
apath.path.pathtype = T_BitmapAnd;
apath.path.parent = rel;
apath.path.pathtarget = rel->reltarget;
apath.path.param_info = NULL; /* not used in bitmap trees */
apath.path.param_info = NULL; /* not used in bitmap trees */
apath.path.pathkeys = NIL;
apath.bitmapquals = paths;
cost_bitmap_and_node(&apath, root);
@ -1982,7 +1982,7 @@ get_loop_count(PlannerInfo *root, Index cur_relid, Relids outer_relids)
outer_rel = root->simple_rel_array[outer_relid];
if (outer_rel == NULL)
continue;
Assert(outer_rel->relid == outer_relid); /* sanity check on array */
Assert(outer_rel->relid == outer_relid); /* sanity check on array */
/* Other relation could be proven empty, if so ignore */
if (IS_DUMMY_REL(outer_rel))
@ -2632,7 +2632,7 @@ match_pathkeys_to_index(IndexOptInfo *index, List *pathkeys,
return;
}
*orderby_clauses_p = orderby_clauses; /* success! */
*orderby_clauses_p = orderby_clauses; /* success! */
*clause_columns_p = clause_columns;
}
@ -3062,7 +3062,7 @@ relation_has_unique_index_for(PlannerInfo *root, RelOptInfo *rel,
if (match_index_to_operand(rexpr, c, ind))
{
matched = true; /* column is unique */
matched = true; /* column is unique */
break;
}
}
@ -3983,7 +3983,7 @@ adjust_rowcompare_for_index(RowCompareExpr *clause,
if (!var_on_left)
{
expr_op = get_commutator(expr_op);
if (!OidIsValid(expr_op)) /* should not happen */
if (!OidIsValid(expr_op)) /* should not happen */
elog(ERROR, "could not find commutator of member %d(%u,%u) of opfamily %u",
op_strategy, lefttype, righttype, opfam);
}

View File

@ -1104,7 +1104,7 @@ generate_mergejoin_paths(PlannerInfo *root,
}
num_sortkeys = list_length(innersortkeys);
if (num_sortkeys > 1 && !useallclauses)
trialsortkeys = list_copy(innersortkeys); /* need modifiable copy */
trialsortkeys = list_copy(innersortkeys); /* need modifiable copy */
else
trialsortkeys = innersortkeys; /* won't really truncate */
@ -1732,7 +1732,7 @@ hash_inner_and_outer(PlannerInfo *root,
if (outerpath == cheapest_startup_outer &&
innerpath == cheapest_total_inner)
continue; /* already tried it */
continue; /* already tried it */
try_hashjoin_path(root,
joinrel,

View File

@ -196,7 +196,7 @@ make_pathkey_from_sortinfo(PlannerInfo *root,
opcintype,
opcintype,
BTEqualStrategyNumber);
if (!OidIsValid(equality_op)) /* shouldn't happen */
if (!OidIsValid(equality_op)) /* shouldn't happen */
elog(ERROR, "could not find equality operator for opfamily %u",
opfamily);
opfamilies = get_mergejoin_opfamilies(equality_op);

View File

@ -63,9 +63,9 @@
* ressortgroupref labels. This is passed down by parent nodes such as Sort
* and Group, which need these values to be available in their inputs.
*/
#define CP_EXACT_TLIST 0x0001 /* Plan must return specified tlist */
#define CP_SMALL_TLIST 0x0002 /* Prefer narrower tlists */
#define CP_LABEL_TLIST 0x0004 /* tlist must contain sortgrouprefs */
#define CP_EXACT_TLIST 0x0001 /* Plan must return specified tlist */
#define CP_SMALL_TLIST 0x0002 /* Prefer narrower tlists */
#define CP_LABEL_TLIST 0x0004 /* tlist must contain sortgrouprefs */
static Plan *create_plan_recurse(PlannerInfo *root, Path *best_path,
@ -1418,7 +1418,7 @@ create_unique_plan(PlannerInfo *root, UniquePath *best_path, int flags)
* for the IN clause operators' RHS datatype.
*/
eqop = get_equality_op_for_ordering_op(sortop, NULL);
if (!OidIsValid(eqop)) /* shouldn't happen */
if (!OidIsValid(eqop)) /* shouldn't happen */
elog(ERROR, "could not find equality operator for ordering operator %u",
sortop);
@ -2908,7 +2908,7 @@ create_bitmap_subplan(PlannerInfo *root, Path *bitmapqual,
plan->total_cost = opath->path.total_cost;
plan->plan_rows =
clamp_row_est(opath->bitmapselectivity * opath->path.parent->tuples);
plan->plan_width = 0; /* meaningless */
plan->plan_width = 0; /* meaningless */
plan->parallel_aware = false;
plan->parallel_safe = opath->path.parallel_safe;
}
@ -3394,7 +3394,7 @@ create_worktablescan_plan(PlannerInfo *root, Path *best_path,
if (!cteroot) /* shouldn't happen */
elog(ERROR, "bad levelsup for CTE \"%s\"", rte->ctename);
}
if (cteroot->wt_param_id < 0) /* shouldn't happen */
if (cteroot->wt_param_id < 0) /* shouldn't happen */
elog(ERROR, "could not find param ID for CTE \"%s\"", rte->ctename);
/* Sort clauses into best execution order */
@ -5726,7 +5726,7 @@ prepare_sort_from_pathkeys(Plan *lefttree, List *pathkeys,
NULL,
true);
tlist = lappend(tlist, tle);
lefttree->targetlist = tlist; /* just in case NIL before */
lefttree->targetlist = tlist; /* just in case NIL before */
}
/*
@ -6426,7 +6426,7 @@ make_modifytable(PlannerInfo *root,
node->partitioned_rels = partitioned_rels;
node->resultRelations = resultRelations;
node->resultRelIndex = -1; /* will be set correctly in setrefs.c */
node->rootResultRelIndex = -1; /* will be set correctly in setrefs.c */
node->rootResultRelIndex = -1; /* will be set correctly in setrefs.c */
node->plans = subplans;
if (!onconflict)
{

View File

@ -287,7 +287,7 @@ find_lateral_references(PlannerInfo *root)
if (brel == NULL)
continue;
Assert(brel->relid == rti); /* sanity check on array */
Assert(brel->relid == rti); /* sanity check on array */
/*
* This bit is less obvious than it might look. We ignore appendrel
@ -436,7 +436,7 @@ create_lateral_join_info(PlannerInfo *root)
if (brel == NULL)
continue;
Assert(brel->relid == rti); /* sanity check on array */
Assert(brel->relid == rti); /* sanity check on array */
/* ignore RTEs that are "other rels" */
if (brel->reloptkind != RELOPT_BASEREL)
@ -945,7 +945,7 @@ deconstruct_recurse(PlannerInfo *root, Node *jtnode, bool below_outer_join,
/* JOIN_RIGHT was eliminated during reduce_outer_joins() */
elog(ERROR, "unrecognized join type: %d",
(int) j->jointype);
nonnullable_rels = NULL; /* keep compiler quiet */
nonnullable_rels = NULL; /* keep compiler quiet */
nullable_rels = NULL;
leftjoinlist = rightjoinlist = NIL;
break;
@ -1214,7 +1214,7 @@ make_outerjoininfo(PlannerInfo *root,
{
sjinfo->min_lefthand = bms_copy(left_rels);
sjinfo->min_righthand = bms_copy(right_rels);
sjinfo->lhs_strict = false; /* don't care about this */
sjinfo->lhs_strict = false; /* don't care about this */
return sjinfo;
}
@ -2047,7 +2047,7 @@ distribute_qual_to_rels(PlannerInfo *root, Node *clause,
static bool
check_outerjoin_delay(PlannerInfo *root,
Relids *relids_p, /* in/out parameter */
Relids *nullable_relids_p, /* output parameter */
Relids *nullable_relids_p, /* output parameter */
bool is_pushed_down)
{
Relids relids;
@ -2304,8 +2304,8 @@ process_implied_equality(PlannerInfo *root,
* original (this is necessary in case there are subselects in there...)
*/
clause = make_opclause(opno,
BOOLOID, /* opresulttype */
false, /* opretset */
BOOLOID, /* opresulttype */
false, /* opretset */
copyObject(item1),
copyObject(item2),
InvalidOid,
@ -2367,8 +2367,8 @@ build_implied_join_equality(Oid opno,
* original (this is necessary in case there are subselects in there...)
*/
clause = make_opclause(opno,
BOOLOID, /* opresulttype */
false, /* opretset */
BOOLOID, /* opresulttype */
false, /* opretset */
copyObject(item1),
copyObject(item2),
InvalidOid,
@ -2378,12 +2378,12 @@ build_implied_join_equality(Oid opno,
* Build the RestrictInfo node itself.
*/
restrictinfo = make_restrictinfo(clause,
true, /* is_pushed_down */
false, /* outerjoin_delayed */
false, /* pseudoconstant */
true, /* is_pushed_down */
false, /* outerjoin_delayed */
false, /* pseudoconstant */
security_level, /* security_level */
qualscope, /* required_relids */
NULL, /* outer_relids */
NULL, /* outer_relids */
nullable_relids); /* nullable_relids */
/* Set mergejoinability/hashjoinability flags */

View File

@ -89,8 +89,8 @@ preprocess_minmax_aggregates(PlannerInfo *root, List *tlist)
if (!parse->hasAggs)
return;
Assert(!parse->setOperations); /* shouldn't get here if a setop */
Assert(parse->rowMarks == NIL); /* nor if FOR UPDATE */
Assert(!parse->setOperations); /* shouldn't get here if a setop */
Assert(parse->rowMarks == NIL); /* nor if FOR UPDATE */
/*
* Reject unoptimizable cases.

View File

@ -246,7 +246,7 @@ query_planner(PlannerInfo *root, List *tlist,
if (brel == NULL)
continue;
Assert(brel->relid == rti); /* sanity check on array */
Assert(brel->relid == rti); /* sanity check on array */
if (IS_SIMPLE_REL(brel))
total_pages += (double) brel->pages;

View File

@ -2412,7 +2412,7 @@ preprocess_rowmarks(PlannerInfo *root)
newrc->markType = select_rowmark_type(rte, LCS_NONE);
newrc->allMarkTypes = (1 << newrc->markType);
newrc->strength = LCS_NONE;
newrc->waitPolicy = LockWaitBlock; /* doesn't matter */
newrc->waitPolicy = LockWaitBlock; /* doesn't matter */
newrc->isParent = false;
prowmarks = lappend(prowmarks, newrc);
@ -2469,7 +2469,7 @@ select_rowmark_type(RangeTblEntry *rte, LockClauseStrength strength)
break;
}
elog(ERROR, "unrecognized LockClauseStrength %d", (int) strength);
return ROW_MARK_EXCLUSIVE; /* keep compiler quiet */
return ROW_MARK_EXCLUSIVE; /* keep compiler quiet */
}
}
@ -2519,7 +2519,7 @@ preprocess_limit(PlannerInfo *root, double tuple_fraction,
{
*count_est = DatumGetInt64(((Const *) est)->constvalue);
if (*count_est <= 0)
*count_est = 1; /* force to at least 1 */
*count_est = 1; /* force to at least 1 */
}
}
else
@ -2653,7 +2653,7 @@ preprocess_limit(PlannerInfo *root, double tuple_fraction,
/* both fractional, so add them together */
tuple_fraction += limit_fraction;
if (tuple_fraction >= 1.0)
tuple_fraction = 0.0; /* assume fetch all */
tuple_fraction = 0.0; /* assume fetch all */
}
}
}
@ -3514,7 +3514,7 @@ create_grouping_paths(PlannerInfo *root,
RelOptInfo *grouped_rel;
PathTarget *partial_grouping_target = NULL;
AggClauseCosts agg_partial_costs; /* parallel only */
AggClauseCosts agg_final_costs; /* parallel only */
AggClauseCosts agg_final_costs; /* parallel only */
Size hashaggtablesize;
double dNumGroups;
double dNumPartialGroups = 0;
@ -5626,7 +5626,7 @@ make_sort_input_target(PlannerInfo *root,
/* Shouldn't get here unless query has ORDER BY */
Assert(parse->sortClause);
*have_postponed_srfs = false; /* default result */
*have_postponed_srfs = false; /* default result */
/* Inspect tlist and collect per-column information */
ncols = list_length(final_target->exprs);

View File

@ -297,7 +297,7 @@ add_rtes_to_flat_rtable(PlannerInfo *root, bool recursing)
if (rel != NULL)
{
Assert(rel->relid == rti); /* sanity check on array */
Assert(rel->relid == rti); /* sanity check on array */
/*
* The subquery might never have been planned at all, if it
@ -1908,7 +1908,7 @@ set_dummy_tlist_references(Plan *plan, int rtoffset)
}
else
{
newvar->varnoold = 0; /* wasn't ever a plain Var */
newvar->varnoold = 0; /* wasn't ever a plain Var */
newvar->varoattno = 0;
}
@ -2137,7 +2137,7 @@ search_indexed_tlist_for_sortgroupref(Expr *node,
Var *newvar;
newvar = makeVarFromTargetEntry(newvarno, tle);
newvar->varnoold = 0; /* wasn't ever a plain Var */
newvar->varnoold = 0; /* wasn't ever a plain Var */
newvar->varoattno = 0;
return newvar;
}

View File

@ -44,7 +44,7 @@ typedef struct pullup_replace_vars_context
RangeTblEntry *target_rte; /* RTE of subquery */
Relids relids; /* relids within subquery, as numbered after
* pullup (set only if target_rte->lateral) */
bool *outer_hasSubLinks; /* -> outer query's hasSubLinks */
bool *outer_hasSubLinks; /* -> outer query's hasSubLinks */
int varno; /* varno of subquery */
bool need_phvs; /* do we need PlaceHolderVars? */
bool wrap_non_vars; /* do we need 'em on *all* non-Vars? */
@ -772,7 +772,7 @@ pull_up_subqueries_recurse(PlannerInfo *root, Node *jtnode,
if (deletion_ok && !have_undeleted_child)
{
/* OK to delete this FromExpr entirely */
root->hasDeletedRTEs = true; /* probably is set already */
root->hasDeletedRTEs = true; /* probably is set already */
return NULL;
}
}
@ -2088,7 +2088,7 @@ pullup_replace_vars_callback(Var *var,
&colnames, &fields);
/* Adjust the generated per-field Vars, but don't insert PHVs */
rcon->need_phvs = false;
context->sublevels_up = 0; /* to match the expandRTE output */
context->sublevels_up = 0; /* to match the expandRTE output */
fields = (List *) replace_rte_variables_mutator((Node *) fields,
context);
rcon->need_phvs = save_need_phvs;
@ -2784,7 +2784,7 @@ reduce_outer_joins_pass2(Node *jtnode,
if (right_state->contains_outer)
{
if (jointype != JOIN_FULL) /* ie, INNER/LEFT/SEMI/ANTI */
if (jointype != JOIN_FULL) /* ie, INNER/LEFT/SEMI/ANTI */
{
/* pass appropriate constraints, per comment above */
pass_nonnullable_rels = local_nonnullable_rels;

View File

@ -301,7 +301,7 @@ expand_targetlist(List *tlist, int command_type,
attcollation,
att_tup->attlen,
(Datum) 0,
true, /* isnull */
true, /* isnull */
att_tup->attbyval);
new_expr = coerce_to_domain(new_expr,
InvalidOid, -1,
@ -319,7 +319,7 @@ expand_targetlist(List *tlist, int command_type,
InvalidOid,
sizeof(int32),
(Datum) 0,
true, /* isnull */
true, /* isnull */
true /* byval */ );
}
break;
@ -341,7 +341,7 @@ expand_targetlist(List *tlist, int command_type,
InvalidOid,
sizeof(int32),
(Datum) 0,
true, /* isnull */
true, /* isnull */
true /* byval */ );
}
break;

View File

@ -1399,7 +1399,7 @@ contain_context_dependent_node(Node *clause)
return contain_context_dependent_node_walker(clause, &flags);
}
#define CCDN_IN_CASEEXPR 0x0001 /* CaseTestExpr okay here? */
#define CCDN_IN_CASEEXPR 0x0001 /* CaseTestExpr okay here? */
static bool
contain_context_dependent_node_walker(Node *node, int *flags)
@ -2434,7 +2434,7 @@ estimate_expression_value(PlannerInfo *root, Node *node)
{
eval_const_expressions_context context;
context.boundParams = root->glob->boundParams; /* bound Params */
context.boundParams = root->glob->boundParams; /* bound Params */
/* we do not need to mark the plan as depending on inlined functions */
context.root = NULL;
context.active_fns = NIL; /* nothing being recursively simplified */
@ -2712,8 +2712,8 @@ eval_const_expressions_mutator(Node *node,
* Need to get OID of underlying function. Okay to
* scribble on input to this extent.
*/
set_opfuncid((OpExpr *) expr); /* rely on struct
* equivalence */
set_opfuncid((OpExpr *) expr); /* rely on struct
* equivalence */
/*
* Code for op/func reduction is pretty bulky, so split it
@ -3114,7 +3114,7 @@ eval_const_expressions_mutator(Node *node,
if (newarg && IsA(newarg, Const))
{
context->case_val = newarg;
newarg = NULL; /* not needed anymore, see above */
newarg = NULL; /* not needed anymore, see above */
}
else
context->case_val = NULL;
@ -3463,7 +3463,7 @@ eval_const_expressions_mutator(Node *node,
default:
elog(ERROR, "unrecognized nulltesttype: %d",
(int) ntest->nulltesttype);
result = false; /* keep compiler quiet */
result = false; /* keep compiler quiet */
break;
}
@ -3517,7 +3517,7 @@ eval_const_expressions_mutator(Node *node,
default:
elog(ERROR, "unrecognized booltesttype: %d",
(int) btest->booltesttype);
result = false; /* keep compiler quiet */
result = false; /* keep compiler quiet */
break;
}
@ -4263,7 +4263,7 @@ evaluate_function(Oid funcid, Oid result_type, int32 result_typmod,
newexpr->funcretset = false;
newexpr->funcvariadic = funcvariadic;
newexpr->funcformat = COERCE_EXPLICIT_CALL; /* doesn't matter */
newexpr->funccollid = result_collid; /* doesn't matter */
newexpr->funccollid = result_collid; /* doesn't matter */
newexpr->inputcollid = input_collid;
newexpr->args = args;
newexpr->location = -1;

View File

@ -84,7 +84,7 @@ extract_restriction_or_clauses(PlannerInfo *root)
if (rel == NULL)
continue;
Assert(rel->relid == rti); /* sanity check on array */
Assert(rel->relid == rti); /* sanity check on array */
/* ignore RTEs that are "other rels" */
if (rel->reloptkind != RELOPT_BASEREL)

View File

@ -411,7 +411,7 @@ set_cheapest(RelOptInfo *parent_rel)
void
add_path(RelOptInfo *parent_rel, Path *new_path)
{
bool accept_new = true; /* unless we find a superior old path */
bool accept_new = true; /* unless we find a superior old path */
ListCell *insert_after = NULL; /* where to insert new item */
List *new_path_pathkeys;
ListCell *p1;
@ -484,7 +484,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET1) &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
remove_old = true; /* new dominates old */
remove_old = true; /* new dominates old */
}
else if (keyscmp == PATHKEYS_BETTER2)
{
@ -492,7 +492,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET2) &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
accept_new = false; /* old dominates new */
accept_new = false; /* old dominates new */
}
else /* keyscmp == PATHKEYS_EQUAL */
{
@ -534,11 +534,11 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
else if (outercmp == BMS_SUBSET1 &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
remove_old = true; /* new dominates old */
remove_old = true; /* new dominates old */
else if (outercmp == BMS_SUBSET2 &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
accept_new = false; /* old dominates new */
accept_new = false; /* old dominates new */
/* else different parameterizations, keep both */
}
break;
@ -551,7 +551,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET1) &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
remove_old = true; /* new dominates old */
remove_old = true; /* new dominates old */
}
break;
case COSTS_BETTER2:
@ -563,7 +563,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET2) &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
accept_new = false; /* old dominates new */
accept_new = false; /* old dominates new */
}
break;
case COSTS_DIFFERENT:
@ -751,7 +751,7 @@ add_path_precheck(RelOptInfo *parent_rel,
void
add_partial_path(RelOptInfo *parent_rel, Path *new_path)
{
bool accept_new = true; /* unless we find a superior old path */
bool accept_new = true; /* unless we find a superior old path */
ListCell *insert_after = NULL; /* where to insert new item */
ListCell *p1;
ListCell *p1_prev;
@ -1081,7 +1081,7 @@ create_bitmap_heap_path(PlannerInfo *root,
pathnode->path.parallel_aware = parallel_degree > 0 ? true : false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = parallel_degree;
pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapqual = bitmapqual;
@ -1118,7 +1118,7 @@ create_bitmap_and_path(PlannerInfo *root,
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapquals = bitmapquals;
@ -1154,7 +1154,7 @@ create_bitmap_or_path(PlannerInfo *root,
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapquals = bitmapquals;
@ -1182,7 +1182,7 @@ create_tidscan_path(PlannerInfo *root, RelOptInfo *rel, List *tidquals,
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->tidquals = tidquals;
@ -1214,8 +1214,7 @@ create_append_path(RelOptInfo *rel, List *subpaths, Relids required_outer,
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = parallel_workers;
pathnode->path.pathkeys = NIL; /* result is always considered
* unsorted */
pathnode->path.pathkeys = NIL; /* result is always considered unsorted */
pathnode->partitioned_rels = list_copy(partitioned_rels);
pathnode->subpaths = subpaths;
@ -1311,7 +1310,7 @@ create_merge_append_path(PlannerInfo *root,
else
{
/* We'll need to insert a Sort node, so include cost for that */
Path sort_path; /* dummy for result of cost_sort */
Path sort_path; /* dummy for result of cost_sort */
cost_sort(&sort_path,
root,
@ -1743,7 +1742,7 @@ create_gather_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath,
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = false;
pathnode->path.parallel_workers = 0;
pathnode->path.pathkeys = NIL; /* Gather has unordered result */
pathnode->path.pathkeys = NIL; /* Gather has unordered result */
pathnode->subpath = subpath;
pathnode->num_workers = subpath->parallel_workers;
@ -2818,8 +2817,8 @@ create_groupingsets_path(PlannerInfo *root,
}
else
{
Path sort_path; /* dummy for result of cost_sort */
Path agg_path; /* dummy for result of cost_agg */
Path sort_path; /* dummy for result of cost_sort */
Path agg_path; /* dummy for result of cost_agg */
if (rollup->is_hashed || is_first_sort)
{

View File

@ -101,7 +101,7 @@ find_placeholder_info(PlannerInfo *root, PlaceHolderVar *phv,
rels_used = pull_varnos((Node *) phv->phexpr);
phinfo->ph_lateral = bms_difference(rels_used, phv->phrels);
if (bms_is_empty(phinfo->ph_lateral))
phinfo->ph_lateral = NULL; /* make it exactly NULL if empty */
phinfo->ph_lateral = NULL; /* make it exactly NULL if empty */
phinfo->ph_eval_at = bms_int_members(rels_used, phv->phrels);
/* If no contained vars, force evaluation at syntactic location */
if (bms_is_empty(phinfo->ph_eval_at))

View File

@ -354,8 +354,8 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent,
/* Build targetlist using the completed indexprs data */
info->indextlist = build_index_tlist(root, info, relation);
info->indrestrictinfo = NIL; /* set later, in indxpath.c */
info->predOK = false; /* set later, in indxpath.c */
info->indrestrictinfo = NIL; /* set later, in indxpath.c */
info->predOK = false; /* set later, in indxpath.c */
info->unique = index->indisunique;
info->immediate = index->indimmediate;
info->hypothetical = false;
@ -827,7 +827,7 @@ infer_collation_opclass_match(InferenceElem *elem, Relation idxRel,
List *idxExprs)
{
AttrNumber natt;
Oid inferopfamily = InvalidOid; /* OID of opclass opfamily */
Oid inferopfamily = InvalidOid; /* OID of opclass opfamily */
Oid inferopcinputtype = InvalidOid; /* OID of opclass input type */
int nplain = 0; /* # plain attrs observed */

View File

@ -382,7 +382,7 @@ predicate_implied_by_recurse(Node *clause, Node *predicate,
iterate_end(pred_info);
if (!presult)
{
result = false; /* doesn't imply any of B's */
result = false; /* doesn't imply any of B's */
break;
}
}
@ -650,7 +650,7 @@ predicate_refuted_by_recurse(Node *clause, Node *predicate,
iterate_end(pred_info);
if (!presult)
{
result = false; /* citem refutes nothing */
result = false; /* citem refutes nothing */
break;
}
}
@ -1360,12 +1360,12 @@ static const bool BT_implies_table[6][6] = {
* The predicate operator:
* LT LE EQ GE GT NE
*/
{TRUE, TRUE, none, none, none, TRUE}, /* LT */
{none, TRUE, none, none, none, none}, /* LE */
{none, TRUE, TRUE, TRUE, none, none}, /* EQ */
{none, none, none, TRUE, none, none}, /* GE */
{none, none, none, TRUE, TRUE, TRUE}, /* GT */
{none, none, none, none, none, TRUE} /* NE */
{TRUE, TRUE, none, none, none, TRUE}, /* LT */
{none, TRUE, none, none, none, none}, /* LE */
{none, TRUE, TRUE, TRUE, none, none}, /* EQ */
{none, none, none, TRUE, none, none}, /* GE */
{none, none, none, TRUE, TRUE, TRUE}, /* GT */
{none, none, none, none, none, TRUE} /* NE */
};
static const bool BT_refutes_table[6][6] = {
@ -1373,12 +1373,12 @@ static const bool BT_refutes_table[6][6] = {
* The predicate operator:
* LT LE EQ GE GT NE
*/
{none, none, TRUE, TRUE, TRUE, none}, /* LT */
{none, none, none, none, TRUE, none}, /* LE */
{TRUE, none, none, none, TRUE, TRUE}, /* EQ */
{TRUE, none, none, none, none, none}, /* GE */
{TRUE, TRUE, TRUE, none, none, none}, /* GT */
{none, none, TRUE, none, none, none} /* NE */
{none, none, TRUE, TRUE, TRUE, none}, /* LT */
{none, none, none, none, TRUE, none}, /* LE */
{TRUE, none, none, none, TRUE, TRUE}, /* EQ */
{TRUE, none, none, none, none, none}, /* GE */
{TRUE, TRUE, TRUE, none, none, none}, /* GT */
{none, none, TRUE, none, none, none} /* NE */
};
static const StrategyNumber BT_implic_table[6][6] = {
@ -1386,12 +1386,12 @@ static const StrategyNumber BT_implic_table[6][6] = {
* The predicate operator:
* LT LE EQ GE GT NE
*/
{BTGE, BTGE, none, none, none, BTGE}, /* LT */
{BTGT, BTGE, none, none, none, BTGT}, /* LE */
{BTGT, BTGE, BTEQ, BTLE, BTLT, BTNE}, /* EQ */
{none, none, none, BTLE, BTLT, BTLT}, /* GE */
{none, none, none, BTLE, BTLE, BTLE}, /* GT */
{none, none, none, none, none, BTEQ} /* NE */
{BTGE, BTGE, none, none, none, BTGE}, /* LT */
{BTGT, BTGE, none, none, none, BTGT}, /* LE */
{BTGT, BTGE, BTEQ, BTLE, BTLT, BTNE}, /* EQ */
{none, none, none, BTLE, BTLT, BTLT}, /* GE */
{none, none, none, BTLE, BTLE, BTLE}, /* GT */
{none, none, none, none, none, BTEQ} /* NE */
};
static const StrategyNumber BT_refute_table[6][6] = {
@ -1399,12 +1399,12 @@ static const StrategyNumber BT_refute_table[6][6] = {
* The predicate operator:
* LT LE EQ GE GT NE
*/
{none, none, BTGE, BTGE, BTGE, none}, /* LT */
{none, none, BTGT, BTGT, BTGE, none}, /* LE */
{BTLE, BTLT, BTNE, BTGT, BTGE, BTEQ}, /* EQ */
{BTLE, BTLT, BTLT, none, none, none}, /* GE */
{BTLE, BTLE, BTLE, none, none, none}, /* GT */
{none, none, BTEQ, none, none, none} /* NE */
{none, none, BTGE, BTGE, BTGE, none}, /* LT */
{none, none, BTGT, BTGT, BTGE, none}, /* LE */
{BTLE, BTLT, BTNE, BTGT, BTGE, BTEQ}, /* EQ */
{BTLE, BTLT, BTLT, none, none, none}, /* GE */
{BTLE, BTLE, BTLE, none, none, none}, /* GT */
{none, none, BTEQ, none, none, none} /* NE */
};

View File

@ -108,8 +108,8 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptInfo *parent)
rel->rows = 0;
/* cheap startup cost is interesting iff not all tuples to be retrieved */
rel->consider_startup = (root->tuple_fraction > 0);
rel->consider_param_startup = false; /* might get changed later */
rel->consider_parallel = false; /* might get changed later */
rel->consider_param_startup = false; /* might get changed later */
rel->consider_parallel = false; /* might get changed later */
rel->reltarget = create_empty_pathtarget();
rel->pathlist = NIL;
rel->ppilist = NIL;
@ -132,7 +132,7 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptInfo *parent)
rel->allvisfrac = 0;
rel->subroot = NULL;
rel->subplan_params = NIL;
rel->rel_parallel_workers = -1; /* set up in get_relation_info */
rel->rel_parallel_workers = -1; /* set up in get_relation_info */
rel->serverid = InvalidOid;
rel->userid = rte->checkAsUser;
rel->useridiscurrent = false;
@ -944,7 +944,7 @@ fetch_upper_rel(PlannerInfo *root, UpperRelationKind kind, Relids relids)
/* cheap startup cost is interesting iff not all tuples to be retrieved */
upperrel->consider_startup = (root->tuple_fraction > 0);
upperrel->consider_param_startup = false;
upperrel->consider_parallel = false; /* might get changed later */
upperrel->consider_parallel = false; /* might get changed later */
upperrel->reltarget = create_empty_pathtarget();
upperrel->pathlist = NIL;
upperrel->cheapest_startup_path = NULL;

View File

@ -114,7 +114,7 @@ make_restrictinfo_internal(Expr *clause,
restrictinfo->is_pushed_down = is_pushed_down;
restrictinfo->outerjoin_delayed = outerjoin_delayed;
restrictinfo->pseudoconstant = pseudoconstant;
restrictinfo->can_join = false; /* may get set below */
restrictinfo->can_join = false; /* may get set below */
restrictinfo->security_level = security_level;
restrictinfo->outer_relids = outer_relids;
restrictinfo->nullable_relids = nullable_relids;
@ -127,7 +127,7 @@ make_restrictinfo_internal(Expr *clause,
if (security_level > 0)
restrictinfo->leakproof = !contain_leaked_vars((Node *) clause);
else
restrictinfo->leakproof = false; /* really, "don't know" */
restrictinfo->leakproof = false; /* really, "don't know" */
/*
* If it's a binary opclause, set up left/right relids info. In any case

View File

@ -28,12 +28,12 @@
/* Workspace for split_pathtarget_walker */
typedef struct
{
List *input_target_exprs; /* exprs available from input */
List *input_target_exprs; /* exprs available from input */
List *level_srfs; /* list of lists of SRF exprs */
List *level_input_vars; /* vars needed by SRFs of each level */
List *level_input_srfs; /* SRFs needed by SRFs of each level */
List *current_input_vars; /* vars needed in current subexpr */
List *current_input_srfs; /* SRFs needed in current subexpr */
List *level_input_vars; /* vars needed by SRFs of each level */
List *level_input_srfs; /* SRFs needed by SRFs of each level */
List *current_input_vars; /* vars needed in current subexpr */
List *current_input_srfs; /* SRFs needed in current subexpr */
int current_depth; /* max SRF depth in current subexpr */
} split_pathtarget_context;
@ -145,7 +145,7 @@ add_to_flat_tlist(List *tlist, List *exprs)
{
TargetEntry *tle;
tle = makeTargetEntry(copyObject(expr), /* copy needed?? */
tle = makeTargetEntry(copyObject(expr), /* copy needed?? */
next_resno++,
NULL,
false);

View File

@ -62,8 +62,8 @@ typedef struct
{
PlannerInfo *root;
int sublevels_up;
bool possible_sublink; /* could aliases include a SubLink? */
bool inserted_sublink; /* have we inserted a SubLink? */
bool possible_sublink; /* could aliases include a SubLink? */
bool inserted_sublink; /* have we inserted a SubLink? */
} flatten_join_alias_vars_context;
static bool pull_varnos_walker(Node *node,