1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +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

@ -25,11 +25,11 @@
*/
typedef struct
{
int current_index;
int head_offset;
TimestampTz head_timestamp;
int count_used;
TransactionId xid_by_minute[FLEXIBLE_ARRAY_MEMBER];
int current_index;
int head_offset;
TimestampTz head_timestamp;
int count_used;
TransactionId xid_by_minute[FLEXIBLE_ARRAY_MEMBER];
} OldSnapshotTimeMapping;
#define NUM_TIME_MAPPING_COLUMNS 3
@ -53,7 +53,7 @@ pg_old_snapshot_time_mapping(PG_FUNCTION_ARGS)
if (SRF_IS_FIRSTCALL())
{
MemoryContext oldcontext;
MemoryContext oldcontext;
funcctx = SRF_FIRSTCALL_INIT();
oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
@ -127,24 +127,25 @@ MakeOldSnapshotTimeMappingTupleDesc(void)
static HeapTuple
MakeOldSnapshotTimeMappingTuple(TupleDesc tupdesc, OldSnapshotTimeMapping *mapping)
{
Datum values[NUM_TIME_MAPPING_COLUMNS];
bool nulls[NUM_TIME_MAPPING_COLUMNS];
int array_position;
TimestampTz timestamp;
Datum values[NUM_TIME_MAPPING_COLUMNS];
bool nulls[NUM_TIME_MAPPING_COLUMNS];
int array_position;
TimestampTz timestamp;
/*
* Figure out the array position corresponding to the current index.
*
* Index 0 means the oldest entry in the mapping, which is stored at
* mapping->head_offset. Index 1 means the next-oldest entry, which is a the
* following index, and so on. We wrap around when we reach the end of the array.
* mapping->head_offset. Index 1 means the next-oldest entry, which is a
* the following index, and so on. We wrap around when we reach the end of
* the array.
*/
array_position = (mapping->head_offset + mapping->current_index)
% OLD_SNAPSHOT_TIME_MAP_ENTRIES;
/*
* No explicit timestamp is stored for any entry other than the oldest one,
* but each entry corresponds to 1-minute period, so we can just add.
* No explicit timestamp is stored for any entry other than the oldest
* one, but each entry corresponds to 1-minute period, so we can just add.
*/
timestamp = TimestampTzPlusMilliseconds(mapping->head_timestamp,
mapping->current_index * 60000);