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/statistics | |
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/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/backend/statistics')
-rw-r--r-- | src/backend/statistics/dependencies.c | 12 | ||||
-rw-r--r-- | src/backend/statistics/extended_stats.c | 2 | ||||
-rw-r--r-- | src/backend/statistics/mvdistinct.c | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/backend/statistics/dependencies.c b/src/backend/statistics/dependencies.c index ef131adc915..89dece33504 100644 --- a/src/backend/statistics/dependencies.c +++ b/src/backend/statistics/dependencies.c @@ -49,13 +49,13 @@ typedef struct DependencyGeneratorData typedef DependencyGeneratorData *DependencyGenerator; static void generate_dependencies_recurse(DependencyGenerator state, - int index, AttrNumber start, AttrNumber *current); + int index, AttrNumber start, AttrNumber *current); static void generate_dependencies(DependencyGenerator state); static DependencyGenerator DependencyGenerator_init(int n, int k); static void DependencyGenerator_free(DependencyGenerator state); static AttrNumber *DependencyGenerator_next(DependencyGenerator state); static double dependency_degree(int numrows, HeapTuple *rows, int k, - AttrNumber *dependency, VacAttrStats **stats, Bitmapset *attrs); + AttrNumber *dependency, VacAttrStats **stats, Bitmapset *attrs); static bool dependency_is_fully_matched(MVDependency *dependency, Bitmapset *attnums); static bool dependency_implies_attribute(MVDependency *dependency, @@ -122,7 +122,7 @@ generate_dependencies_recurse(DependencyGenerator state, int index, if (!match) { state->dependencies = (AttrNumber *) repalloc(state->dependencies, - state->k * (state->ndependencies + 1) * sizeof(AttrNumber)); + state->k * (state->ndependencies + 1) * sizeof(AttrNumber)); memcpy(&state->dependencies[(state->k * state->ndependencies)], current, state->k * sizeof(AttrNumber)); state->ndependencies++; @@ -308,7 +308,7 @@ dependency_degree(int numrows, HeapTuple *rows, int k, AttrNumber *dependency, * to the preceding one. */ if (i == numrows || - multi_sort_compare_dims(0, k - 2, &items[i - 1], &items[i], mss) != 0) + multi_sort_compare_dims(0, k - 2, &items[i - 1], &items[i], mss) != 0) { /* * If no violations were found in the group then track the rows of @@ -430,8 +430,8 @@ statext_dependencies_build(int numrows, HeapTuple *rows, Bitmapset *attrs, dependencies->ndeps++; dependencies = (MVDependencies *) repalloc(dependencies, - offsetof(MVDependencies, deps) - + dependencies->ndeps * sizeof(MVDependency)); + offsetof(MVDependencies, deps) + + dependencies->ndeps * sizeof(MVDependency)); dependencies->deps[dependencies->ndeps - 1] = d; } diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c index 73d7ef3c271..db4987bde38 100644 --- a/src/backend/statistics/extended_stats.c +++ b/src/backend/statistics/extended_stats.c @@ -121,7 +121,7 @@ BuildRelationExtStatistics(Relation onerel, double totalrows, stat->columns, stats); else if (t == STATS_EXT_DEPENDENCIES) dependencies = statext_dependencies_build(numrows, rows, - stat->columns, stats); + stat->columns, stats); } /* store the statistics in the catalog */ diff --git a/src/backend/statistics/mvdistinct.c b/src/backend/statistics/mvdistinct.c index 4b8d8926d29..913829233ec 100644 --- a/src/backend/statistics/mvdistinct.c +++ b/src/backend/statistics/mvdistinct.c @@ -101,7 +101,7 @@ statext_ndistinct_build(double totalrows, int numrows, HeapTuple *rows, item->attrs = NULL; for (j = 0; j < k; j++) item->attrs = bms_add_member(item->attrs, - stats[combination[j]]->attr->attnum); + stats[combination[j]]->attr->attnum); item->ndistinct = ndistinct_for_combination(totalrows, numrows, rows, stats, k, combination); @@ -275,8 +275,8 @@ statext_ndistinct_deserialize(bytea *data) if (VARSIZE_ANY_EXHDR(data) < minimum_size) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("invalid MVNDistinct size %zd (expected at least %zd)", - VARSIZE_ANY_EXHDR(data), minimum_size))); + errmsg("invalid MVNDistinct size %zd (expected at least %zd)", + VARSIZE_ANY_EXHDR(data), minimum_size))); /* * Allocate space for the ndistinct items (no space for each item's |