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

Initial pgindent and pgperltidy run for v14.

Also "make reformat-dat-files".

The only change worthy of note is that pgindent messed up the formatting
of launcher.c's struct LogicalRepWorkerId, which led me to notice that
that struct wasn't used at all anymore, so I just took it out.
This commit is contained in:
Tom Lane
2021-05-12 13:14:10 -04:00
parent e6ccd1ce16
commit def5b065ff
230 changed files with 2408 additions and 2125 deletions

View File

@ -427,6 +427,7 @@ ExecSupportsMarkRestore(Path *pathnode)
{
case T_IndexScan:
case T_IndexOnlyScan:
/*
* Not all index types support mark/restore.
*/

View File

@ -26,7 +26,7 @@ void
ExecAsyncRequest(AsyncRequest *areq)
{
if (areq->requestee->chgParam != NULL) /* something changed? */
ExecReScan(areq->requestee); /* let ReScan handle this */
ExecReScan(areq->requestee); /* let ReScan handle this */
/* must provide our own instrumentation support */
if (areq->requestee->instrument)
@ -124,7 +124,7 @@ ExecAsyncResponse(AsyncRequest *areq)
default:
/* If the node doesn't support async, caller messed up. */
elog(ERROR, "unrecognized node type: %d",
(int) nodeTag(areq->requestor));
(int) nodeTag(areq->requestor));
}
}

View File

@ -132,8 +132,8 @@ ExecutorStart(QueryDesc *queryDesc, int eflags)
/*
* In some cases (e.g. an EXECUTE statement) a query execution will skip
* parse analysis, which means that the query_id won't be reported. Note
* that it's harmless to report the query_id multiple time, as the call will
* be ignored if the top level query_id has already been reported.
* that it's harmless to report the query_id multiple time, as the call
* will be ignored if the top level query_id has already been reported.
*/
pgstat_report_query_id(queryDesc->plannedstmt->queryId, false);

View File

@ -917,8 +917,8 @@ ExecInitRoutingInfo(ModifyTableState *mtstate,
partRelInfo->ri_FdwRoutine->BeginForeignInsert(mtstate, partRelInfo);
/*
* Determine if the FDW supports batch insert and determine the batch
* size (a FDW may support batching, but it may be disabled for the
* Determine if the FDW supports batch insert and determine the batch size
* (a FDW may support batching, but it may be disabled for the
* server/table or for this particular query).
*
* If the FDW does not support batching, we set the batch size to 1.

View File

@ -349,7 +349,7 @@ typedef struct HashAggSpill
int64 *ntuples; /* number of tuples in each partition */
uint32 mask; /* mask to find partition from hash value */
int shift; /* after masking, shift by this amount */
hyperLogLogState *hll_card; /* cardinality estimate for contents */
hyperLogLogState *hll_card; /* cardinality estimate for contents */
} HashAggSpill;
/*
@ -374,9 +374,9 @@ typedef struct HashAggBatch
/* used to find referenced colnos */
typedef struct FindColsContext
{
bool is_aggref; /* is under an aggref */
Bitmapset *aggregated; /* column references under an aggref */
Bitmapset *unaggregated; /* other column references */
bool is_aggref; /* is under an aggref */
Bitmapset *aggregated; /* column references under an aggref */
Bitmapset *unaggregated; /* other column references */
} FindColsContext;
static void select_current_set(AggState *aggstate, int setno, bool is_hash);
@ -1397,7 +1397,7 @@ project_aggregates(AggState *aggstate)
static void
find_cols(AggState *aggstate, Bitmapset **aggregated, Bitmapset **unaggregated)
{
Agg *agg = (Agg *) aggstate->ss.ps.plan;
Agg *agg = (Agg *) aggstate->ss.ps.plan;
FindColsContext context;
context.is_aggref = false;
@ -1579,7 +1579,8 @@ find_hash_columns(AggState *aggstate)
for (int i = 0; i < scanDesc->natts; i++)
{
int colno = i + 1;
int colno = i + 1;
if (bms_is_member(colno, aggstate->colnos_needed))
aggstate->max_colno_needed = colno;
else
@ -3158,10 +3159,10 @@ hashagg_spill_finish(AggState *aggstate, HashAggSpill *spill, int setno)
for (i = 0; i < spill->npartitions; i++)
{
LogicalTapeSet *tapeset = aggstate->hash_tapeinfo->tapeset;
int tapenum = spill->partitions[i];
HashAggBatch *new_batch;
double cardinality;
LogicalTapeSet *tapeset = aggstate->hash_tapeinfo->tapeset;
int tapenum = spill->partitions[i];
HashAggBatch *new_batch;
double cardinality;
/* if the partition is empty, don't create a new batch of work */
if (spill->ntuples[i] == 0)

View File

@ -566,9 +566,9 @@ choose_next_subplan_locally(AppendState *node)
/*
* If first call then have the bms member function choose the first valid
* sync subplan by initializing whichplan to -1. If there happen to be
* no valid sync subplans then the bms member function will handle that
* by returning a negative number which will allow us to exit returning a
* sync subplan by initializing whichplan to -1. If there happen to be no
* valid sync subplans then the bms member function will handle that by
* returning a negative number which will allow us to exit returning a
* false value.
*/
if (whichplan == INVALID_SUBPLAN_INDEX)
@ -925,8 +925,8 @@ ExecAppendAsyncGetNext(AppendState *node, TupleTableSlot **result)
/*
* If all sync subplans are complete, we're totally done scanning the
* given node. Otherwise, we're done with the asynchronous stuff but
* must continue scanning the sync subplans.
* given node. Otherwise, we're done with the asynchronous stuff but must
* continue scanning the sync subplans.
*/
if (node->as_syncdone)
{
@ -1003,7 +1003,7 @@ ExecAppendAsyncEventWait(AppendState *node)
{
int nevents = node->as_nasyncplans + 1;
long timeout = node->as_syncdone ? -1 : 0;
WaitEvent occurred_event[EVENT_BUFFER_SIZE];
WaitEvent occurred_event[EVENT_BUFFER_SIZE];
int noccurred;
int i;
@ -1054,8 +1054,8 @@ ExecAppendAsyncEventWait(AppendState *node)
/*
* Mark it as no longer needing a callback. We must do this
* before dispatching the callback in case the callback resets
* the flag.
* before dispatching the callback in case the callback resets the
* flag.
*/
Assert(areq->callback_pending);
areq->callback_pending = false;

View File

@ -266,7 +266,7 @@ gather_getnext(GatherState *gatherstate)
PlanState *outerPlan = outerPlanState(gatherstate);
TupleTableSlot *outerTupleSlot;
TupleTableSlot *fslot = gatherstate->funnel_slot;
MinimalTuple tup;
MinimalTuple tup;
while (gatherstate->nreaders > 0 || gatherstate->need_to_scan_locally)
{
@ -278,7 +278,7 @@ gather_getnext(GatherState *gatherstate)
if (HeapTupleIsValid(tup))
{
ExecStoreMinimalTuple(tup, /* tuple to store */
ExecStoreMinimalTuple(tup, /* tuple to store */
fslot, /* slot to store the tuple */
false); /* don't pfree tuple */
return fslot;

View File

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

View File

@ -1162,8 +1162,8 @@ ExecReScanIncrementalSort(IncrementalSortState *node)
}
/*
* If chgParam of subnode is not null, then the plan will be re-scanned
* by the first ExecProcNode.
* If chgParam of subnode is not null, then the plan will be re-scanned by
* the first ExecProcNode.
*/
if (outerPlan->chgParam == NULL)
ExecReScan(outerPlan);

View File

@ -61,12 +61,12 @@ typedef struct MTTargetRelLookup
} MTTargetRelLookup;
static void ExecBatchInsert(ModifyTableState *mtstate,
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int numSlots,
EState *estate,
bool canSetTag);
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int numSlots,
EState *estate,
bool canSetTag);
static bool ExecOnConflictUpdate(ModifyTableState *mtstate,
ResultRelInfo *resultRelInfo,
ItemPointer conflictTid,
@ -673,17 +673,17 @@ ExecInsert(ModifyTableState *mtstate,
if (resultRelInfo->ri_BatchSize > 1)
{
/*
* If a certain number of tuples have already been accumulated,
* or a tuple has come for a different relation than that for
* the accumulated tuples, perform the batch insert
* If a certain number of tuples have already been accumulated, or
* a tuple has come for a different relation than that for the
* accumulated tuples, perform the batch insert
*/
if (resultRelInfo->ri_NumSlots == resultRelInfo->ri_BatchSize)
{
ExecBatchInsert(mtstate, resultRelInfo,
resultRelInfo->ri_Slots,
resultRelInfo->ri_PlanSlots,
resultRelInfo->ri_NumSlots,
estate, canSetTag);
resultRelInfo->ri_Slots,
resultRelInfo->ri_PlanSlots,
resultRelInfo->ri_NumSlots,
estate, canSetTag);
resultRelInfo->ri_NumSlots = 0;
}
@ -692,9 +692,9 @@ ExecInsert(ModifyTableState *mtstate,
if (resultRelInfo->ri_Slots == NULL)
{
resultRelInfo->ri_Slots = palloc(sizeof(TupleTableSlot *) *
resultRelInfo->ri_BatchSize);
resultRelInfo->ri_BatchSize);
resultRelInfo->ri_PlanSlots = palloc(sizeof(TupleTableSlot *) *
resultRelInfo->ri_BatchSize);
resultRelInfo->ri_BatchSize);
}
resultRelInfo->ri_Slots[resultRelInfo->ri_NumSlots] =
@ -982,12 +982,12 @@ ExecInsert(ModifyTableState *mtstate,
*/
static void
ExecBatchInsert(ModifyTableState *mtstate,
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int numSlots,
EState *estate,
bool canSetTag)
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int numSlots,
EState *estate,
bool canSetTag)
{
int i;
int numInserted = numSlots;
@ -998,10 +998,10 @@ ExecBatchInsert(ModifyTableState *mtstate,
* insert into foreign table: let the FDW do it
*/
rslots = resultRelInfo->ri_FdwRoutine->ExecForeignBatchInsert(estate,
resultRelInfo,
slots,
planSlots,
&numInserted);
resultRelInfo,
slots,
planSlots,
&numInserted);
for (i = 0; i < numInserted; i++)
{
@ -2604,10 +2604,10 @@ ExecModifyTable(PlanState *pstate)
resultRelInfo = lfirst(lc);
if (resultRelInfo->ri_NumSlots > 0)
ExecBatchInsert(node, resultRelInfo,
resultRelInfo->ri_Slots,
resultRelInfo->ri_PlanSlots,
resultRelInfo->ri_NumSlots,
estate, node->canSetTag);
resultRelInfo->ri_Slots,
resultRelInfo->ri_PlanSlots,
resultRelInfo->ri_NumSlots,
estate, node->canSetTag);
}
/*
@ -3091,12 +3091,12 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
mtstate->mt_resultOidHash = NULL;
/*
* Determine if the FDW supports batch insert and determine the batch
* size (a FDW may support batching, but it may be disabled for the
* Determine if the FDW supports batch insert and determine the batch size
* (a FDW may support batching, but it may be disabled for the
* server/table).
*
* We only do this for INSERT, so that for UPDATE/DELETE the batch
* size remains set to 0.
* We only do this for INSERT, so that for UPDATE/DELETE the batch size
* remains set to 0.
*/
if (operation == CMD_INSERT)
{