diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 15:35:54 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 15:35:54 -0400 |
| commit | 382ceffdf7f620d8f2d50e451b4167d291ae2348 (patch) | |
| tree | f558251492f2c6f86e3566f7a82f9d00509122c2 /src/backend/optimizer/util | |
| parent | c7b8998ebbf310a156aa38022555a24d98fdbfb4 (diff) | |
| download | postgresql-382ceffdf7f620d8f2d50e451b4167d291ae2348.tar.gz | |
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they
flow past the right margin.
By default, BSD indent lines up statement continuation lines that are
within parentheses so that they start just to the right of the preceding
left parenthesis. However, traditionally, if that resulted in the
continuation line extending to the right of the desired right margin,
then indent would push it left just far enough to not overrun the margin,
if it could do so without making the continuation line start to the left of
the current statement indent. That makes for a weird mix of indentations
unless one has been completely rigid about never violating the 80-column
limit.
This behavior has been pretty universally panned by Postgres developers.
Hence, disable it with indent's new -lpl switch, so that parenthesized
lines are always lined up with the preceding left paren.
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
Diffstat (limited to 'src/backend/optimizer/util')
| -rw-r--r-- | src/backend/optimizer/util/clauses.c | 32 | ||||
| -rw-r--r-- | src/backend/optimizer/util/orclauses.c | 2 | ||||
| -rw-r--r-- | src/backend/optimizer/util/pathnode.c | 8 | ||||
| -rw-r--r-- | src/backend/optimizer/util/plancat.c | 6 | ||||
| -rw-r--r-- | src/backend/optimizer/util/relnode.c | 2 | ||||
| -rw-r--r-- | src/backend/optimizer/util/var.c | 4 |
6 files changed, 27 insertions, 27 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index b9e5dc25eb..8961ed88a8 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -147,14 +147,14 @@ static Expr *inline_function(Oid funcid, Oid result_type, Oid result_collid, static Node *substitute_actual_parameters(Node *expr, int nargs, List *args, int *usecounts); static Node *substitute_actual_parameters_mutator(Node *node, - substitute_actual_parameters_context *context); + substitute_actual_parameters_context *context); static void sql_inline_error_callback(void *arg); static Expr *evaluate_expr(Expr *expr, Oid result_type, int32 result_typmod, Oid result_collation); static Query *substitute_actual_srf_parameters(Query *expr, int nargs, List *args); static Node *substitute_actual_srf_parameters_mutator(Node *node, - substitute_actual_srf_parameters_context *context); + substitute_actual_srf_parameters_context *context); static bool tlist_matches_coltypelist(List *tlist, List *coltypelist); @@ -1011,7 +1011,7 @@ contain_volatile_functions_not_nextval_walker(Node *node, void *context) return false; /* Check for volatile functions in node itself */ if (check_functions_in_node(node, - contain_volatile_functions_not_nextval_checker, + contain_volatile_functions_not_nextval_checker, context)) return true; @@ -1026,11 +1026,11 @@ contain_volatile_functions_not_nextval_walker(Node *node, void *context) { /* Recurse into subselects */ return query_tree_walker((Query *) node, - contain_volatile_functions_not_nextval_walker, + contain_volatile_functions_not_nextval_walker, context, 0); } return expression_tree_walker(node, - contain_volatile_functions_not_nextval_walker, + contain_volatile_functions_not_nextval_walker, context); } @@ -1432,7 +1432,7 @@ contain_context_dependent_node_walker(Node *node, int *flags) */ *flags |= CCDN_IN_CASEEXPR; res = expression_tree_walker(node, - contain_context_dependent_node_walker, + contain_context_dependent_node_walker, (void *) flags); *flags = save_flags; return res; @@ -2675,7 +2675,7 @@ eval_const_expressions_mutator(Node *node, * self. */ args = (List *) expression_tree_mutator((Node *) expr->args, - eval_const_expressions_mutator, + eval_const_expressions_mutator, (void *) context); /* @@ -2943,7 +2943,7 @@ eval_const_expressions_mutator(Node *node, -1, InvalidOid, sizeof(Oid), - ObjectIdGetDatum(intypioparam), + ObjectIdGetDatum(intypioparam), false, true), makeConst(INT4OID, @@ -3009,7 +3009,7 @@ eval_const_expressions_mutator(Node *node, */ if (arg && IsA(arg, Const) && (!OidIsValid(newexpr->elemfuncid) || - func_volatile(newexpr->elemfuncid) == PROVOLATILE_IMMUTABLE)) + func_volatile(newexpr->elemfuncid) == PROVOLATILE_IMMUTABLE)) return (Node *) evaluate_expr((Expr *) newexpr, newexpr->resulttype, newexpr->resulttypmod, @@ -3286,7 +3286,7 @@ eval_const_expressions_mutator(Node *node, if (newargs == NIL) return (Node *) makeNullConst(coalesceexpr->coalescetype, -1, - coalesceexpr->coalescecollid); + coalesceexpr->coalescecollid); newcoalesce = makeNode(CoalesceExpr); newcoalesce->coalescetype = coalesceexpr->coalescetype; @@ -3365,7 +3365,7 @@ eval_const_expressions_mutator(Node *node, fselect->fieldnum <= list_length(rowexpr->args)) { Node *fld = (Node *) list_nth(rowexpr->args, - fselect->fieldnum - 1); + fselect->fieldnum - 1); if (rowtype_field_matches(rowexpr->row_typeid, fselect->fieldnum, @@ -3900,7 +3900,7 @@ simplify_function(Oid funcid, Oid result_type, int32 result_typmod, { args = expand_function_arguments(args, result_type, func_tuple); args = (List *) expression_tree_mutator((Node *) args, - eval_const_expressions_mutator, + eval_const_expressions_mutator, (void *) context); /* Argument processing done, give it back to the caller */ *args_p = args; @@ -4623,7 +4623,7 @@ substitute_actual_parameters(Node *expr, int nargs, List *args, static Node * substitute_actual_parameters_mutator(Node *node, - substitute_actual_parameters_context *context) + substitute_actual_parameters_context *context) { if (node == NULL) return NULL; @@ -4943,7 +4943,7 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte) querytree_list = pg_analyze_and_rewrite_params(linitial(raw_parsetree_list), src, - (ParserSetupHook) sql_fn_parser_setup, + (ParserSetupHook) sql_fn_parser_setup, pinfo, NULL); if (list_length(querytree_list) != 1) goto fail; @@ -5066,7 +5066,7 @@ substitute_actual_srf_parameters(Query *expr, int nargs, List *args) static Node * substitute_actual_srf_parameters_mutator(Node *node, - substitute_actual_srf_parameters_context *context) + substitute_actual_srf_parameters_context *context) { Node *result; @@ -5076,7 +5076,7 @@ substitute_actual_srf_parameters_mutator(Node *node, { context->sublevels_up++; result = (Node *) query_tree_mutator((Query *) node, - substitute_actual_srf_parameters_mutator, + substitute_actual_srf_parameters_mutator, (void *) context, 0); context->sublevels_up--; diff --git a/src/backend/optimizer/util/orclauses.c b/src/backend/optimizer/util/orclauses.c index dd7cfc94b8..9aa661c909 100644 --- a/src/backend/optimizer/util/orclauses.c +++ b/src/backend/optimizer/util/orclauses.c @@ -233,7 +233,7 @@ extract_or_clause(RestrictInfo *or_rinfo, RelOptInfo *rel) subclause = (Node *) make_ands_explicit(subclauses); if (or_clause(subclause)) clauselist = list_concat(clauselist, - list_copy(((BoolExpr *) subclause)->args)); + list_copy(((BoolExpr *) subclause)->args)); else clauselist = lappend(clauselist, subclause); } diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index 63afc04b62..77c124e27f 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -477,7 +477,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) { case COSTS_EQUAL: outercmp = bms_subset_compare(PATH_REQ_OUTER(new_path), - PATH_REQ_OUTER(old_path)); + PATH_REQ_OUTER(old_path)); if (keyscmp == PATHKEYS_BETTER1) { if ((outercmp == BMS_EQUAL || @@ -525,7 +525,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) accept_new = false; /* old dominates new */ else if (compare_path_costs_fuzzily(new_path, old_path, - 1.0000000001) == COSTS_BETTER1) + 1.0000000001) == COSTS_BETTER1) remove_old = true; /* new dominates old */ else accept_new = false; /* old equals or @@ -546,7 +546,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) if (keyscmp != PATHKEYS_BETTER2) { outercmp = bms_subset_compare(PATH_REQ_OUTER(new_path), - PATH_REQ_OUTER(old_path)); + PATH_REQ_OUTER(old_path)); if ((outercmp == BMS_EQUAL || outercmp == BMS_SUBSET1) && new_path->rows <= old_path->rows && @@ -558,7 +558,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) if (keyscmp != PATHKEYS_BETTER1) { outercmp = bms_subset_compare(PATH_REQ_OUTER(new_path), - PATH_REQ_OUTER(old_path)); + PATH_REQ_OUTER(old_path)); if ((outercmp == BMS_EQUAL || outercmp == BMS_SUBSET2) && new_path->rows >= old_path->rows && diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index 9dc35c1aef..dc0b0b0706 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -620,7 +620,7 @@ infer_arbiter_indexes(PlannerInfo *root) errmsg("whole row unique index inference specifications are not supported"))); inferAttrs = bms_add_member(inferAttrs, - attno - FirstLowInvalidHeapAttributeNumber); + attno - FirstLowInvalidHeapAttributeNumber); } /* @@ -715,7 +715,7 @@ infer_arbiter_indexes(PlannerInfo *root) if (attno != 0) indexedAttrs = bms_add_member(indexedAttrs, - attno - FirstLowInvalidHeapAttributeNumber); + attno - FirstLowInvalidHeapAttributeNumber); } /* Non-expression attributes (if any) must match */ @@ -1607,7 +1607,7 @@ build_index_tlist(PlannerInfo *root, IndexOptInfo *index, if (indexkey < 0) att_tup = SystemAttributeDefinition(indexkey, - heapRelation->rd_rel->relhasoids); + heapRelation->rd_rel->relhasoids); else att_tup = heapRelation->rd_att->attrs[indexkey - 1]; diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c index 22f5ddac58..c8e2b67da4 100644 --- a/src/backend/optimizer/util/relnode.c +++ b/src/backend/optimizer/util/relnode.c @@ -279,7 +279,7 @@ build_join_rel_hash(PlannerInfo *root) hashtab = hash_create("JoinRelHashTable", 256L, &hash_ctl, - HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT); + HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT); /* Insert all the already-existing joinrels */ foreach(l, root->join_rel_list) diff --git a/src/backend/optimizer/util/var.c b/src/backend/optimizer/util/var.c index 45fa22f918..b8d7d3ffad 100644 --- a/src/backend/optimizer/util/var.c +++ b/src/backend/optimizer/util/var.c @@ -240,7 +240,7 @@ pull_varattnos_walker(Node *node, pull_varattnos_context *context) if (var->varno == context->varno && var->varlevelsup == 0) context->varattnos = bms_add_member(context->varattnos, - var->varattno - FirstLowInvalidHeapAttributeNumber); + var->varattno - FirstLowInvalidHeapAttributeNumber); return false; } @@ -778,7 +778,7 @@ flatten_join_alias_vars_mutator(Node *node, PlaceHolderVar *phv; phv = (PlaceHolderVar *) expression_tree_mutator(node, - flatten_join_alias_vars_mutator, + flatten_join_alias_vars_mutator, (void *) context); /* now fix PlaceHolderVar's relid sets */ if (phv->phlevelsup == context->sublevels_up) |
