1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Initial pgindent run for v12.

This is still using the 2.0 version of pg_bsd_indent.
I thought it would be good to commit this separately,
so as to document the differences between 2.0 and 2.1 behavior.

Discussion: https://postgr.es/m/16296.1558103386@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2019-05-22 12:55:34 -04:00
parent 66a4bad83a
commit be76af171c
221 changed files with 1433 additions and 1302 deletions

View File

@ -2367,10 +2367,10 @@ get_last_attnums_walker(Node *node, LastAttnumInfo *info)
static void
ExecComputeSlotInfo(ExprState *state, ExprEvalStep *op)
{
PlanState *parent = state->parent;
PlanState *parent = state->parent;
TupleDesc desc = NULL;
const TupleTableSlotOps *tts_ops = NULL;
bool isfixed = false;
bool isfixed = false;
if (op->d.fetch.known_desc != NULL)
{
@ -3313,7 +3313,7 @@ ExecBuildAggTransCall(ExprState *state, AggState *aggstate,
*/
ExprState *
ExecBuildGroupingEqual(TupleDesc ldesc, TupleDesc rdesc,
const TupleTableSlotOps * lops, const TupleTableSlotOps * rops,
const TupleTableSlotOps *lops, const TupleTableSlotOps *rops,
int numCols,
const AttrNumber *keyColIdx,
const Oid *eqfunctions,

View File

@ -4038,7 +4038,7 @@ void
ExecEvalSysVar(ExprState *state, ExprEvalStep *op, ExprContext *econtext,
TupleTableSlot *slot)
{
Datum d;
Datum d;
/* slot_getsysattr has sufficient defenses against bad attnums */
d = slot_getsysattr(slot,

View File

@ -2551,7 +2551,7 @@ EvalPlanQualSlot(EPQState *epqstate,
if (relation)
*slot = table_slot_create(relation,
&epqstate->estate->es_tupleTable);
&epqstate->estate->es_tupleTable);
else
*slot = ExecAllocTableSlot(&epqstate->estate->es_tupleTable,
epqstate->origslot->tts_tupleDescriptor,

View File

@ -1058,7 +1058,7 @@ ExecParallelRetrieveJitInstrumentation(PlanState *planstate,
* instrumentation in per-query context.
*/
ibytes = offsetof(SharedJitInstrumentation, jit_instr)
+ mul_size(shared_jit->num_workers, sizeof(JitInstrumentation));
+ mul_size(shared_jit->num_workers, sizeof(JitInstrumentation));
planstate->worker_jit_instrument =
MemoryContextAlloc(planstate->state->es_query_cxt, ibytes);
@ -1133,7 +1133,7 @@ ExecParallelCleanup(ParallelExecutorInfo *pei)
/* Accumulate JIT instrumentation, if any. */
if (pei->jit_instrumentation)
ExecParallelRetrieveJitInstrumentation(pei->planstate,
pei->jit_instrumentation);
pei->jit_instrumentation);
/* Free any serialized parameters. */
if (DsaPointerIsValid(pei->param_exec))

View File

@ -145,12 +145,12 @@ typedef struct PartitionDispatchData
TupleTableSlot *tupslot;
AttrNumber *tupmap;
int indexes[FLEXIBLE_ARRAY_MEMBER];
} PartitionDispatchData;
} PartitionDispatchData;
/* struct to hold result relations coming from UPDATE subplans */
typedef struct SubplanResultRelHashElem
{
Oid relid; /* hash key -- must be first */
Oid relid; /* hash key -- must be first */
ResultRelInfo *rri;
} SubplanResultRelHashElem;
@ -375,7 +375,7 @@ ExecFindPartition(ModifyTableState *mtstate,
if (proute->subplan_resultrel_htab)
{
Oid partoid = partdesc->oids[partidx];
SubplanResultRelHashElem *elem;
SubplanResultRelHashElem *elem;
elem = hash_search(proute->subplan_resultrel_htab,
&partoid, HASH_FIND, NULL);
@ -474,7 +474,7 @@ ExecHashSubPlanResultRelsByOid(ModifyTableState *mtstate,
ResultRelInfo *rri = &mtstate->resultRelInfo[i];
bool found;
Oid partoid = RelationGetRelid(rri->ri_RelationDesc);
SubplanResultRelHashElem *elem;
SubplanResultRelHashElem *elem;
elem = (SubplanResultRelHashElem *)
hash_search(htab, &partoid, HASH_ENTER, &found);
@ -762,9 +762,9 @@ ExecInitPartitionInfo(ModifyTableState *mtstate, EState *estate,
* It's safe to reuse these from the partition root, as we
* only process one tuple at a time (therefore we won't
* overwrite needed data in slots), and the results of
* projections are independent of the underlying
* storage. Projections and where clauses themselves don't
* store state / are independent of the underlying storage.
* projections are independent of the underlying storage.
* Projections and where clauses themselves don't store state
* / are independent of the underlying storage.
*/
leaf_part_rri->ri_onConflict->oc_ProjSlot =
rootResultRelInfo->ri_onConflict->oc_ProjSlot;
@ -892,7 +892,7 @@ ExecInitRoutingInfo(ModifyTableState *mtstate,
{
MemoryContext oldcxt;
PartitionRoutingInfo *partrouteinfo;
int rri_index;
int rri_index;
oldcxt = MemoryContextSwitchTo(proute->memcxt);
@ -1668,16 +1668,16 @@ ExecCreatePartitionPruneState(PlanState *planstate,
}
else
{
int pd_idx = 0;
int pp_idx;
int pd_idx = 0;
int pp_idx;
/*
* Some new partitions have appeared since plan time, and
* those are reflected in our PartitionDesc but were not
* present in the one used to construct subplan_map and
* subpart_map. So we must construct new and longer arrays
* where the partitions that were originally present map to the
* same place, and any added indexes map to -1, as if the
* where the partitions that were originally present map to
* the same place, and any added indexes map to -1, as if the
* new partitions had been pruned.
*/
pprune->subpart_map = palloc(sizeof(int) * partdesc->nparts);

View File

@ -227,7 +227,7 @@ retry:
static bool
tuples_equal(TupleTableSlot *slot1, TupleTableSlot *slot2)
{
int attrnum;
int attrnum;
Assert(slot1->tts_tupleDescriptor->natts ==
slot2->tts_tupleDescriptor->natts);
@ -265,8 +265,8 @@ tuples_equal(TupleTableSlot *slot1, TupleTableSlot *slot2)
if (!DatumGetBool(FunctionCall2Coll(&typentry->eq_opr_finfo,
att->attcollation,
slot1->tts_values[attrnum],
slot2->tts_values[attrnum])))
slot1->tts_values[attrnum],
slot2->tts_values[attrnum])))
return false;
}
@ -406,7 +406,7 @@ ExecSimpleRelationInsert(EState *estate, TupleTableSlot *slot)
resultRelInfo->ri_TrigDesc->trig_insert_before_row)
{
if (!ExecBRInsertTriggers(estate, resultRelInfo, slot))
skip_tuple = true; /* "do nothing" */
skip_tuple = true; /* "do nothing" */
}
if (!skip_tuple)
@ -471,7 +471,7 @@ ExecSimpleRelationUpdate(EState *estate, EPQState *epqstate,
{
if (!ExecBRUpdateTriggers(estate, epqstate, resultRelInfo,
tid, NULL, slot))
skip_tuple = true; /* "do nothing" */
skip_tuple = true; /* "do nothing" */
}
if (!skip_tuple)
@ -490,7 +490,7 @@ ExecSimpleRelationUpdate(EState *estate, EPQState *epqstate,
if (resultRelInfo->ri_PartitionCheck)
ExecPartitionCheck(resultRelInfo, slot, estate, true);
simple_table_update(rel, tid, slot,estate->es_snapshot,
simple_table_update(rel, tid, slot, estate->es_snapshot,
&update_indexes);
if (resultRelInfo->ri_NumIndices > 0 && update_indexes)
@ -591,8 +591,8 @@ CheckSubscriptionRelkind(char relkind, const char *nspname,
const char *relname)
{
/*
* We currently only support writing to regular tables. However, give
* a more specific error for partitioned and foreign tables.
* We currently only support writing to regular tables. However, give a
* more specific error for partitioned and foreign tables.
*/
if (relkind == RELKIND_PARTITIONED_TABLE)
ereport(ERROR,
@ -600,14 +600,14 @@ CheckSubscriptionRelkind(char relkind, const char *nspname,
errmsg("cannot use relation \"%s.%s\" as logical replication target",
nspname, relname),
errdetail("\"%s.%s\" is a partitioned table.",
nspname, relname)));
nspname, relname)));
else if (relkind == RELKIND_FOREIGN_TABLE)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("cannot use relation \"%s.%s\" as logical replication target",
nspname, relname),
errdetail("\"%s.%s\" is a foreign table.",
nspname, relname)));
nspname, relname)));
if (relkind != RELKIND_RELATION)
ereport(ERROR,
@ -615,5 +615,5 @@ CheckSubscriptionRelkind(char relkind, const char *nspname,
errmsg("cannot use relation \"%s.%s\" as logical replication target",
nspname, relname),
errdetail("\"%s.%s\" is not a table.",
nspname, relname)));
nspname, relname)));
}

View File

@ -81,7 +81,8 @@ ExecScanFetch(ScanState *node,
/* Check if it meets the access-method conditions */
if (!(*recheckMtd) (node, slot))
return ExecClearTuple(slot); /* would not be returned by scan */
return ExecClearTuple(slot); /* would not be returned by
* scan */
return slot;
}

View File

@ -71,13 +71,12 @@
static TupleDesc ExecTypeFromTLInternal(List *targetList,
bool skipjunk);
static pg_attribute_always_inline void
slot_deform_heap_tuple(TupleTableSlot *slot, HeapTuple tuple, uint32 *offp,
static pg_attribute_always_inline void slot_deform_heap_tuple(TupleTableSlot *slot, HeapTuple tuple, uint32 *offp,
int natts);
static inline void tts_buffer_heap_store_tuple(TupleTableSlot *slot,
HeapTuple tuple,
Buffer buffer,
bool transfer_pin);
HeapTuple tuple,
Buffer buffer,
bool transfer_pin);
static void tts_heap_store_tuple(TupleTableSlot *slot, HeapTuple tuple, bool shouldFree);
@ -138,7 +137,7 @@ tts_virtual_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
{
elog(ERROR, "virtual tuple table slot does not have system attributes");
return 0; /* silence compiler warnings */
return 0; /* silence compiler warnings */
}
/*
@ -164,7 +163,7 @@ tts_virtual_materialize(TupleTableSlot *slot)
for (int natt = 0; natt < desc->natts; natt++)
{
Form_pg_attribute att = TupleDescAttr(desc, natt);
Datum val;
Datum val;
if (att->attbyval || slot->tts_isnull[natt])
continue;
@ -200,7 +199,7 @@ tts_virtual_materialize(TupleTableSlot *slot)
for (int natt = 0; natt < desc->natts; natt++)
{
Form_pg_attribute att = TupleDescAttr(desc, natt);
Datum val;
Datum val;
if (att->attbyval || slot->tts_isnull[natt])
continue;
@ -210,7 +209,7 @@ tts_virtual_materialize(TupleTableSlot *slot)
if (att->attlen == -1 &&
VARATT_IS_EXTERNAL_EXPANDED(DatumGetPointer(val)))
{
Size data_length;
Size data_length;
/*
* We want to flatten the expanded value so that the materialized
@ -228,7 +227,7 @@ tts_virtual_materialize(TupleTableSlot *slot)
}
else
{
Size data_length = 0;
Size data_length = 0;
data = (char *) att_align_nominal(data, att->attalign);
data_length = att_addlength_datum(data_length, att->attlen, val);
@ -382,7 +381,7 @@ tts_heap_materialize(TupleTableSlot *slot)
static void
tts_heap_copyslot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
{
HeapTuple tuple;
HeapTuple tuple;
MemoryContext oldcontext;
oldcontext = MemoryContextSwitchTo(dstslot->tts_mcxt);
@ -499,7 +498,7 @@ tts_minimal_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
{
elog(ERROR, "minimal tuple table slot does not have system attributes");
return 0; /* silence compiler warnings */
return 0; /* silence compiler warnings */
}
static void
@ -1077,8 +1076,10 @@ TupleTableSlot *
MakeTupleTableSlot(TupleDesc tupleDesc,
const TupleTableSlotOps *tts_ops)
{
Size basesz, allocsz;
Size basesz,
allocsz;
TupleTableSlot *slot;
basesz = tts_ops->base_slot_size;
/*
@ -1866,7 +1867,7 @@ void
slot_getsomeattrs_int(TupleTableSlot *slot, int attnum)
{
/* Check for caller errors */
Assert(slot->tts_nvalid < attnum); /* slot_getsomeattr checked */
Assert(slot->tts_nvalid < attnum); /* slot_getsomeattr checked */
Assert(attnum > 0);
if (unlikely(attnum > slot->tts_tupleDescriptor->natts))
@ -1876,8 +1877,8 @@ slot_getsomeattrs_int(TupleTableSlot *slot, int attnum)
slot->tts_ops->getsomeattrs(slot, attnum);
/*
* If the underlying tuple doesn't have enough attributes, tuple descriptor
* must have the missing attributes.
* If the underlying tuple doesn't have enough attributes, tuple
* descriptor must have the missing attributes.
*/
if (unlikely(slot->tts_nvalid < attnum))
{

View File

@ -1762,7 +1762,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
if (junkFilter)
{
TupleTableSlot *slot =
MakeSingleTupleTableSlot(NULL, &TTSOpsMinimalTuple);
MakeSingleTupleTableSlot(NULL, &TTSOpsMinimalTuple);
*junkFilter = ExecInitJunkFilter(tlist, slot);
}
@ -1929,7 +1929,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
if (junkFilter)
{
TupleTableSlot *slot =
MakeSingleTupleTableSlot(NULL, &TTSOpsMinimalTuple);
MakeSingleTupleTableSlot(NULL, &TTSOpsMinimalTuple);
*junkFilter = ExecInitJunkFilterConversion(tlist,
CreateTupleDescCopy(tupdesc),

View File

@ -754,7 +754,7 @@ process_ordered_aggregate_single(AggState *aggstate,
oldAbbrevVal == newAbbrevVal &&
DatumGetBool(FunctionCall2Coll(&pertrans->equalfnOne,
pertrans->aggCollation,
oldVal, *newVal)))))
oldVal, *newVal)))))
{
/* equal to prior, so forget this one */
if (!pertrans->inputtypeByVal && !*isNull)

View File

@ -700,10 +700,10 @@ gather_merge_readnext(GatherMergeState *gm_state, int reader, bool nowait)
Assert(HeapTupleIsValid(tup));
/* Build the TupleTableSlot for the given tuple */
ExecStoreHeapTuple(tup, /* tuple to store */
ExecStoreHeapTuple(tup, /* tuple to store */
gm_state->gm_slots[reader], /* slot in which to store
* the tuple */
true); /* pfree tuple when done with it */
true); /* pfree tuple when done with it */
return true;
}

View File

@ -750,7 +750,7 @@ ExecInitHashJoin(HashJoin *node, EState *estate, int eflags)
rclauses = lappend(rclauses, ExecInitExpr(lsecond(hclause->args),
(PlanState *) hjstate));
rhclauses = lappend(rhclauses, ExecInitExpr(lsecond(hclause->args),
innerPlanState(hjstate)));
innerPlanState(hjstate)));
hoperators = lappend_oid(hoperators, hclause->opno);
hcollations = lappend_oid(hcollations, hclause->inputcollid);
}

View File

@ -192,9 +192,9 @@ IndexOnlyNext(IndexOnlyScanState *node)
/*
* Fill the scan tuple slot with data from the index. This might be
* provided in either HeapTuple or IndexTuple format. Conceivably
* an index AM might fill both fields, in which case we prefer the
* heap format, since it's probably a bit cheaper to fill a slot from.
* provided in either HeapTuple or IndexTuple format. Conceivably an
* index AM might fill both fields, in which case we prefer the heap
* format, since it's probably a bit cheaper to fill a slot from.
*/
if (scandesc->xs_hitup)
{

View File

@ -242,7 +242,7 @@ IndexNextWithReorder(IndexScanState *node)
scandesc->xs_orderbynulls,
node) <= 0)
{
HeapTuple tuple;
HeapTuple tuple;
tuple = reorderqueue_pop(node);

View File

@ -327,7 +327,7 @@ ExecInitLockRows(LockRows *node, EState *estate, int eflags)
/* node returns unmodified slots from the outer plan */
lrstate->ps.resultopsset = true;
lrstate->ps.resultops = ExecGetResultSlotOps(outerPlanState(lrstate),
&lrstate->ps.resultopsfixed);
&lrstate->ps.resultopsfixed);
/*
* LockRows nodes do no projections, so initialize projection info for

View File

@ -865,6 +865,7 @@ ldelete:;
goto ldelete;
case TM_SelfModified:
/*
* This can be reached when following an update
* chain from a tuple updated by another session,
@ -1070,7 +1071,7 @@ ExecUpdate(ModifyTableState *mtstate,
{
if (!ExecBRUpdateTriggers(estate, epqstate, resultRelInfo,
tupleid, oldtuple, slot))
return NULL; /* "do nothing" */
return NULL; /* "do nothing" */
}
/* INSTEAD OF ROW UPDATE Triggers */
@ -1079,7 +1080,7 @@ ExecUpdate(ModifyTableState *mtstate,
{
if (!ExecIRUpdateTriggers(estate, resultRelInfo,
oldtuple, slot))
return NULL; /* "do nothing" */
return NULL; /* "do nothing" */
}
else if (resultRelInfo->ri_FdwRoutine)
{
@ -1401,6 +1402,7 @@ lreplace:;
return NULL;
case TM_SelfModified:
/*
* This can be reached when following an update
* chain from a tuple updated by another session,

View File

@ -228,8 +228,8 @@ ExecReScanSeqScan(SeqScanState *node)
scan = node->ss.ss_currentScanDesc;
if (scan != NULL)
table_rescan(scan, /* scan desc */
NULL); /* new scan keys */
table_rescan(scan, /* scan desc */
NULL); /* new scan keys */
ExecScanReScan((ScanState *) node);
}

View File

@ -684,7 +684,7 @@ execTuplesUnequal(TupleTableSlot *slot1,
/* Apply the type-specific equality function */
if (!DatumGetBool(FunctionCall2Coll(&eqfunctions[i],
collations[i],
attr1, attr2)))
attr1, attr2)))
{
result = true; /* they are unequal */
break;

View File

@ -131,6 +131,7 @@ ExecInitSubqueryScan(SubqueryScan *node, EState *estate, int eflags)
ExecInitScanTupleSlot(estate, &subquerystate->ss,
ExecGetResultType(subquerystate->subplan),
ExecGetResultSlotOps(subquerystate->subplan, NULL));
/*
* The slot used as the scantuple isn't the slot above (outside of EPQ),
* but the one from the node below.