diff options
author | Tom Lane | 2017-06-21 19:35:54 +0000 |
---|---|---|
committer | Tom Lane | 2017-06-21 19:35:54 +0000 |
commit | 382ceffdf7f620d8f2d50e451b4167d291ae2348 (patch) | |
tree | f558251492f2c6f86e3566f7a82f9d00509122c2 /src/backend/optimizer/plan/planner.c | |
parent | c7b8998ebbf310a156aa38022555a24d98fdbfb4 (diff) |
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/[email protected]
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/optimizer/plan/planner.c')
-rw-r--r-- | src/backend/optimizer/plan/planner.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index 4b32f59128b..2988c1181b9 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -1311,7 +1311,7 @@ inheritance_planner(PlannerInfo *root) else final_rtable = list_concat(final_rtable, list_copy_tail(subroot->parse->rtable, - list_length(final_rtable))); + list_length(final_rtable))); /* * We need to collect all the RelOptInfos from all child plans into @@ -1543,7 +1543,7 @@ grouping_planner(PlannerInfo *root, bool inheritance_update, translator: %s is a SQL row locking clause such as FOR UPDATE */ errmsg("%s is not allowed with UNION/INTERSECT/EXCEPT", LCS_asString(((RowMarkClause *) - linitial(parse->rowMarks))->strength)))); + linitial(parse->rowMarks))->strength)))); /* * Calculate pathkeys that represent result ordering requirements @@ -1978,7 +1978,7 @@ grouping_planner(PlannerInfo *root, bool inheritance_update, { path = (Path *) create_lockrows_path(root, final_rel, path, root->rowMarks, - SS_assign_special_param(root)); + SS_assign_special_param(root)); } /* @@ -2233,7 +2233,7 @@ preprocess_grouping_sets(PlannerInfo *root) */ gd->hash_sets_idx = remap_to_groupclause_idx(parse->groupClause, gd->unsortable_sets, - gd->tleref_to_colnum_map); + gd->tleref_to_colnum_map); gd->any_hashable = true; } @@ -2778,7 +2778,7 @@ remove_useless_groupby_columns(PlannerInfo *root) relid = var->varno; Assert(relid <= list_length(parse->rtable)); groupbyattnos[relid] = bms_add_member(groupbyattnos[relid], - var->varattno - FirstLowInvalidHeapAttributeNumber); + var->varattno - FirstLowInvalidHeapAttributeNumber); } /* @@ -2827,7 +2827,7 @@ remove_useless_groupby_columns(PlannerInfo *root) */ if (surplusvars == NULL) surplusvars = (Bitmapset **) palloc0(sizeof(Bitmapset *) * - (list_length(parse->rtable) + 1)); + (list_length(parse->rtable) + 1)); /* Remember the attnos of the removable columns */ surplusvars[relid] = bms_difference(relattnos, pkattnos); @@ -2859,8 +2859,8 @@ remove_useless_groupby_columns(PlannerInfo *root) */ if (!IsA(var, Var) || var->varlevelsup > 0 || - !bms_is_member(var->varattno - FirstLowInvalidHeapAttributeNumber, - surplusvars[var->varno])) + !bms_is_member(var->varattno - FirstLowInvalidHeapAttributeNumber, + surplusvars[var->varno])) new_groupby = lappend(new_groupby, sgc); } @@ -3653,7 +3653,7 @@ create_grouping_paths(PlannerInfo *root, */ can_hash = (parse->groupClause != NIL && agg_costs->numOrderedAggs == 0 && - (gd ? gd->any_hashable : grouping_is_hashable(parse->groupClause))); + (gd ? gd->any_hashable : grouping_is_hashable(parse->groupClause))); /* * If grouped_rel->consider_parallel is true, then paths that we generate @@ -3774,9 +3774,9 @@ create_grouping_paths(PlannerInfo *root, create_agg_path(root, grouped_rel, path, - partial_grouping_target, - parse->groupClause ? AGG_SORTED : AGG_PLAIN, - AGGSPLIT_INITIAL_SERIAL, + partial_grouping_target, + parse->groupClause ? AGG_SORTED : AGG_PLAIN, + AGGSPLIT_INITIAL_SERIAL, parse->groupClause, NIL, &agg_partial_costs, @@ -3786,10 +3786,10 @@ create_grouping_paths(PlannerInfo *root, create_group_path(root, grouped_rel, path, - partial_grouping_target, + partial_grouping_target, parse->groupClause, NIL, - dNumPartialGroups)); + dNumPartialGroups)); } } } @@ -3867,7 +3867,7 @@ create_grouping_paths(PlannerInfo *root, grouped_rel, path, target, - parse->groupClause ? AGG_SORTED : AGG_PLAIN, + parse->groupClause ? AGG_SORTED : AGG_PLAIN, AGGSPLIT_SIMPLE, parse->groupClause, (List *) parse->havingQual, @@ -3931,7 +3931,7 @@ create_grouping_paths(PlannerInfo *root, grouped_rel, path, target, - parse->groupClause ? AGG_SORTED : AGG_PLAIN, + parse->groupClause ? AGG_SORTED : AGG_PLAIN, AGGSPLIT_FINAL_DESERIAL, parse->groupClause, (List *) parse->havingQual, @@ -3993,7 +3993,7 @@ create_grouping_paths(PlannerInfo *root, grouped_rel, gmpath, target, - parse->groupClause ? AGG_SORTED : AGG_PLAIN, + parse->groupClause ? AGG_SORTED : AGG_PLAIN, AGGSPLIT_FINAL_DESERIAL, parse->groupClause, (List *) parse->havingQual, @@ -4243,7 +4243,7 @@ consider_groupingsets_paths(PlannerInfo *root, rollup->gsets_data = list_make1(gs); rollup->gsets = remap_to_groupclause_idx(rollup->groupClause, rollup->gsets_data, - gd->tleref_to_colnum_map); + gd->tleref_to_colnum_map); rollup->numGroups = gs->numGroups; rollup->hashable = true; rollup->is_hashed = true; @@ -4373,7 +4373,7 @@ consider_groupingsets_paths(PlannerInfo *root, { double sz = estimate_hashagg_tablesize(path, agg_costs, - rollup->numGroups); + rollup->numGroups); /* * If sz is enormous, but work_mem (and hence scale) is @@ -4407,7 +4407,7 @@ consider_groupingsets_paths(PlannerInfo *root, { if (bms_is_member(i, hash_items)) hash_sets = list_concat(hash_sets, - list_copy(rollup->gsets_data)); + list_copy(rollup->gsets_data)); else rollups = lappend(rollups, rollup); ++i; @@ -4432,7 +4432,7 @@ consider_groupingsets_paths(PlannerInfo *root, rollup->gsets_data = list_make1(gs); rollup->gsets = remap_to_groupclause_idx(rollup->groupClause, rollup->gsets_data, - gd->tleref_to_colnum_map); + gd->tleref_to_colnum_map); rollup->numGroups = gs->numGroups; rollup->hashable = true; rollup->is_hashed = true; @@ -4757,7 +4757,7 @@ create_distinct_paths(PlannerInfo *root, add_path(distinct_rel, (Path *) create_upper_unique_path(root, distinct_rel, path, - list_length(root->distinct_pathkeys), + list_length(root->distinct_pathkeys), numDistinctRows)); } } @@ -4784,7 +4784,7 @@ create_distinct_paths(PlannerInfo *root, add_path(distinct_rel, (Path *) create_upper_unique_path(root, distinct_rel, path, - list_length(root->distinct_pathkeys), + list_length(root->distinct_pathkeys), numDistinctRows)); } @@ -4849,7 +4849,7 @@ create_distinct_paths(PlannerInfo *root, if (distinct_rel->fdwroutine && distinct_rel->fdwroutine->GetForeignUpperPaths) distinct_rel->fdwroutine->GetForeignUpperPaths(root, UPPERREL_DISTINCT, - input_rel, distinct_rel); + input_rel, distinct_rel); /* Let extensions possibly add some more paths */ if (create_upper_paths_hook) @@ -5525,7 +5525,7 @@ make_pathkeys_for_window(PlannerInfo *root, WindowClause *wc, ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("could not implement window ORDER BY"), - errdetail("Window ordering columns must be of sortable datatypes."))); + errdetail("Window ordering columns must be of sortable datatypes."))); /* Okay, make the combined pathkeys */ window_sortclauses = list_concat(list_copy(wc->partitionClause), @@ -5739,7 +5739,7 @@ make_sort_input_target(PlannerInfo *root, postponable_cols = lappend(postponable_cols, expr); else add_column_to_pathtarget(input_target, expr, - get_pathtarget_sortgroupref(final_target, i)); + get_pathtarget_sortgroupref(final_target, i)); i++; } @@ -5793,7 +5793,7 @@ get_cheapest_fractional_path(RelOptInfo *rel, double tuple_fraction) Path *path = (Path *) lfirst(l); if (path == rel->cheapest_total_path || - compare_fractional_path_costs(best_path, path, tuple_fraction) <= 0) + compare_fractional_path_costs(best_path, path, tuple_fraction) <= 0) continue; best_path = path; |