mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
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
This commit is contained in:
@ -1026,8 +1026,8 @@ numerictypmodin(PG_FUNCTION_ARGS)
|
||||
if (tl[1] < 0 || tl[1] > tl[0])
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("NUMERIC scale %d must be between 0 and precision %d",
|
||||
tl[1], tl[0])));
|
||||
errmsg("NUMERIC scale %d must be between 0 and precision %d",
|
||||
tl[1], tl[0])));
|
||||
typmod = ((tl[0] << 16) | tl[1]) + VARHDRSZ;
|
||||
}
|
||||
else if (n == 1)
|
||||
@ -1497,7 +1497,7 @@ width_bucket_numeric(PG_FUNCTION_ARGS)
|
||||
NUMERIC_IS_NAN(bound2))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
|
||||
errmsg("operand, lower bound, and upper bound cannot be NaN")));
|
||||
errmsg("operand, lower bound, and upper bound cannot be NaN")));
|
||||
|
||||
init_var(&result_var);
|
||||
init_var(&count_var);
|
||||
@ -1509,8 +1509,8 @@ width_bucket_numeric(PG_FUNCTION_ARGS)
|
||||
{
|
||||
case 0:
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
|
||||
errmsg("lower bound cannot equal upper bound")));
|
||||
(errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
|
||||
errmsg("lower bound cannot equal upper bound")));
|
||||
|
||||
/* bound1 < bound2 */
|
||||
case -1:
|
||||
@ -1770,7 +1770,7 @@ numeric_abbrev_abort(int memtupcount, SortSupport ssup)
|
||||
if (trace_sort)
|
||||
elog(LOG,
|
||||
"numeric_abbrev: aborting abbreviation at cardinality %f"
|
||||
" below threshold %f after " INT64_FORMAT " values (%d rows)",
|
||||
" below threshold %f after " INT64_FORMAT " values (%d rows)",
|
||||
abbr_card, nss->input_count / 10000.0 + 0.5,
|
||||
nss->input_count, memtupcount);
|
||||
#endif
|
||||
@ -8361,7 +8361,7 @@ cmp_abs(NumericVar *var1, NumericVar *var2)
|
||||
*/
|
||||
static int
|
||||
cmp_abs_common(const NumericDigit *var1digits, int var1ndigits, int var1weight,
|
||||
const NumericDigit *var2digits, int var2ndigits, int var2weight)
|
||||
const NumericDigit *var2digits, int var2ndigits, int var2weight)
|
||||
{
|
||||
int i1 = 0;
|
||||
int i2 = 0;
|
||||
|
Reference in New Issue
Block a user