mirror of
https://github.com/postgres/postgres.git
synced 2025-07-20 05:03:10 +03:00
Initial pgindent and pgperltidy run for v13.
Includes some manual cleanup of places that pgindent messed up,
most of which weren't per project style anyway.
Notably, it seems some people didn't absorb the style rules of
commit c9d297751
, because there were a bunch of new occurrences
of function calls with a newline just after the left paren, all
with faulty expectations about how the rest of the call would get
indented.
This commit is contained in:
@ -167,15 +167,16 @@ static Datum ExecJustAssignOuterVarVirt(ExprState *state, ExprContext *econtext,
|
||||
static Datum ExecJustAssignScanVarVirt(ExprState *state, ExprContext *econtext, bool *isnull);
|
||||
|
||||
/* execution helper functions */
|
||||
static pg_attribute_always_inline void
|
||||
ExecAggPlainTransByVal(AggState *aggstate, AggStatePerTrans pertrans,
|
||||
AggStatePerGroup pergroup,
|
||||
ExprContext *aggcontext, int setno);
|
||||
|
||||
static pg_attribute_always_inline void
|
||||
ExecAggPlainTransByRef(AggState *aggstate, AggStatePerTrans pertrans,
|
||||
AggStatePerGroup pergroup,
|
||||
ExprContext *aggcontext, int setno);
|
||||
static pg_attribute_always_inline void ExecAggPlainTransByVal(AggState *aggstate,
|
||||
AggStatePerTrans pertrans,
|
||||
AggStatePerGroup pergroup,
|
||||
ExprContext *aggcontext,
|
||||
int setno);
|
||||
static pg_attribute_always_inline void ExecAggPlainTransByRef(AggState *aggstate,
|
||||
AggStatePerTrans pertrans,
|
||||
AggStatePerGroup pergroup,
|
||||
ExprContext *aggcontext,
|
||||
int setno);
|
||||
|
||||
/*
|
||||
* Prepare ExprState for interpreted execution.
|
||||
@ -1611,8 +1612,8 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
||||
EEO_CASE(EEOP_AGG_PLAIN_PERGROUP_NULLCHECK)
|
||||
{
|
||||
AggState *aggstate = castNode(AggState, state->parent);
|
||||
AggStatePerGroup pergroup_allaggs = aggstate->all_pergroups
|
||||
[op->d.agg_plain_pergroup_nullcheck.setoff];
|
||||
AggStatePerGroup pergroup_allaggs =
|
||||
aggstate->all_pergroups[op->d.agg_plain_pergroup_nullcheck.setoff];
|
||||
|
||||
if (pergroup_allaggs == NULL)
|
||||
EEO_JUMP(op->d.agg_plain_pergroup_nullcheck.jumpnull);
|
||||
@ -1636,9 +1637,8 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
||||
{
|
||||
AggState *aggstate = castNode(AggState, state->parent);
|
||||
AggStatePerTrans pertrans = op->d.agg_trans.pertrans;
|
||||
AggStatePerGroup pergroup = &aggstate->all_pergroups
|
||||
[op->d.agg_trans.setoff]
|
||||
[op->d.agg_trans.transno];
|
||||
AggStatePerGroup pergroup =
|
||||
&aggstate->all_pergroups[op->d.agg_trans.setoff][op->d.agg_trans.transno];
|
||||
|
||||
Assert(pertrans->transtypeByVal);
|
||||
|
||||
@ -1665,9 +1665,8 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
||||
{
|
||||
AggState *aggstate = castNode(AggState, state->parent);
|
||||
AggStatePerTrans pertrans = op->d.agg_trans.pertrans;
|
||||
AggStatePerGroup pergroup = &aggstate->all_pergroups
|
||||
[op->d.agg_trans.setoff]
|
||||
[op->d.agg_trans.transno];
|
||||
AggStatePerGroup pergroup =
|
||||
&aggstate->all_pergroups[op->d.agg_trans.setoff][op->d.agg_trans.transno];
|
||||
|
||||
Assert(pertrans->transtypeByVal);
|
||||
|
||||
@ -1684,9 +1683,8 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
||||
{
|
||||
AggState *aggstate = castNode(AggState, state->parent);
|
||||
AggStatePerTrans pertrans = op->d.agg_trans.pertrans;
|
||||
AggStatePerGroup pergroup = &aggstate->all_pergroups
|
||||
[op->d.agg_trans.setoff]
|
||||
[op->d.agg_trans.transno];
|
||||
AggStatePerGroup pergroup =
|
||||
&aggstate->all_pergroups[op->d.agg_trans.setoff][op->d.agg_trans.transno];
|
||||
|
||||
Assert(pertrans->transtypeByVal);
|
||||
|
||||
@ -1702,9 +1700,8 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
||||
{
|
||||
AggState *aggstate = castNode(AggState, state->parent);
|
||||
AggStatePerTrans pertrans = op->d.agg_trans.pertrans;
|
||||
AggStatePerGroup pergroup = &aggstate->all_pergroups
|
||||
[op->d.agg_trans.setoff]
|
||||
[op->d.agg_trans.transno];
|
||||
AggStatePerGroup pergroup =
|
||||
&aggstate->all_pergroups[op->d.agg_trans.setoff][op->d.agg_trans.transno];
|
||||
|
||||
Assert(!pertrans->transtypeByVal);
|
||||
|
||||
@ -1724,9 +1721,8 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
||||
{
|
||||
AggState *aggstate = castNode(AggState, state->parent);
|
||||
AggStatePerTrans pertrans = op->d.agg_trans.pertrans;
|
||||
AggStatePerGroup pergroup = &aggstate->all_pergroups
|
||||
[op->d.agg_trans.setoff]
|
||||
[op->d.agg_trans.transno];
|
||||
AggStatePerGroup pergroup =
|
||||
&aggstate->all_pergroups[op->d.agg_trans.setoff][op->d.agg_trans.transno];
|
||||
|
||||
Assert(!pertrans->transtypeByVal);
|
||||
|
||||
@ -1742,9 +1738,8 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
||||
{
|
||||
AggState *aggstate = castNode(AggState, state->parent);
|
||||
AggStatePerTrans pertrans = op->d.agg_trans.pertrans;
|
||||
AggStatePerGroup pergroup = &aggstate->all_pergroups
|
||||
[op->d.agg_trans.setoff]
|
||||
[op->d.agg_trans.transno];
|
||||
AggStatePerGroup pergroup =
|
||||
&aggstate->all_pergroups[op->d.agg_trans.setoff][op->d.agg_trans.transno];
|
||||
|
||||
Assert(!pertrans->transtypeByVal);
|
||||
|
||||
@ -4302,21 +4297,20 @@ ExecAggPlainTransByRef(AggState *aggstate, AggStatePerTrans pertrans,
|
||||
newVal = FunctionCallInvoke(fcinfo);
|
||||
|
||||
/*
|
||||
* For pass-by-ref datatype, must copy the new value into
|
||||
* aggcontext and free the prior transValue. But if transfn
|
||||
* returned a pointer to its first input, we don't need to do
|
||||
* anything. Also, if transfn returned a pointer to a R/W
|
||||
* expanded object that is already a child of the aggcontext,
|
||||
* assume we can adopt that value without copying it.
|
||||
* For pass-by-ref datatype, must copy the new value into aggcontext and
|
||||
* free the prior transValue. But if transfn returned a pointer to its
|
||||
* first input, we don't need to do anything. Also, if transfn returned a
|
||||
* pointer to a R/W expanded object that is already a child of the
|
||||
* aggcontext, assume we can adopt that value without copying it.
|
||||
*
|
||||
* It's safe to compare newVal with pergroup->transValue without
|
||||
* regard for either being NULL, because ExecAggTransReparent()
|
||||
* takes care to set transValue to 0 when NULL. Otherwise we could
|
||||
* end up accidentally not reparenting, when the transValue has
|
||||
* the same numerical value as newValue, despite being NULL. This
|
||||
* is a somewhat hot path, making it undesirable to instead solve
|
||||
* this with another branch for the common case of the transition
|
||||
* function returning its (modified) input argument.
|
||||
* It's safe to compare newVal with pergroup->transValue without regard
|
||||
* for either being NULL, because ExecAggTransReparent() takes care to set
|
||||
* transValue to 0 when NULL. Otherwise we could end up accidentally not
|
||||
* reparenting, when the transValue has the same numerical value as
|
||||
* newValue, despite being NULL. This is a somewhat hot path, making it
|
||||
* undesirable to instead solve this with another branch for the common
|
||||
* case of the transition function returning its (modified) input
|
||||
* argument.
|
||||
*/
|
||||
if (DatumGetPointer(newVal) != DatumGetPointer(pergroup->transValue))
|
||||
newVal = ExecAggTransReparent(aggstate, pertrans,
|
||||
|
Reference in New Issue
Block a user