Skip to content

Commit def5b06

Browse files
committed
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.
1 parent e6ccd1c commit def5b06

File tree

230 files changed

+2415
-2132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+2415
-2132
lines changed

contrib/amcheck/t/001_verify_heapam.pl

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
#
5252
fresh_test_table('test');
5353
$node->safe_psql('postgres', q(VACUUM (FREEZE, DISABLE_PAGE_SKIPPING) test));
54-
detects_no_corruption(
55-
"verify_heapam('test')",
54+
detects_no_corruption("verify_heapam('test')",
5655
"all-frozen not corrupted table");
5756
corrupt_first_page('test');
5857
detects_heap_corruption("verify_heapam('test')",

contrib/amcheck/verify_heapam.c

+25-14
Original file line numberDiff line numberDiff line change
@@ -839,13 +839,16 @@ check_tuple_visibility(HeapCheckContext *ctx)
839839
return false;
840840

841841
case XID_COMMITTED:
842+
842843
/*
843844
* The tuple is dead, because the xvac transaction moved
844-
* it off and committed. It's checkable, but also prunable.
845+
* it off and committed. It's checkable, but also
846+
* prunable.
845847
*/
846848
return true;
847849

848850
case XID_ABORTED:
851+
849852
/*
850853
* The original xmin must have committed, because the xvac
851854
* transaction tried to move it later. Since xvac is
@@ -905,6 +908,7 @@ check_tuple_visibility(HeapCheckContext *ctx)
905908
return false;
906909

907910
case XID_COMMITTED:
911+
908912
/*
909913
* The original xmin must have committed, because the xvac
910914
* transaction moved it later. Whether it's still alive
@@ -913,9 +917,11 @@ check_tuple_visibility(HeapCheckContext *ctx)
913917
break;
914918

915919
case XID_ABORTED:
920+
916921
/*
917922
* The tuple is dead, because the xvac transaction moved
918-
* it off and committed. It's checkable, but also prunable.
923+
* it off and committed. It's checkable, but also
924+
* prunable.
919925
*/
920926
return true;
921927
}
@@ -924,12 +930,12 @@ check_tuple_visibility(HeapCheckContext *ctx)
924930
{
925931
/*
926932
* Inserting transaction is not in progress, and not committed, so
927-
* it might have changed the TupleDesc in ways we don't know about.
928-
* Thus, don't try to check the tuple structure.
933+
* it might have changed the TupleDesc in ways we don't know
934+
* about. Thus, don't try to check the tuple structure.
929935
*
930936
* If xmin_status happens to be XID_IS_CURRENT_XID, then in theory
931-
* any such DDL changes ought to be visible to us, so perhaps
932-
* we could check anyway in that case. But, for now, let's be
937+
* any such DDL changes ought to be visible to us, so perhaps we
938+
* could check anyway in that case. But, for now, let's be
933939
* conservative and treat this like any other uncommitted insert.
934940
*/
935941
return false;
@@ -945,18 +951,19 @@ check_tuple_visibility(HeapCheckContext *ctx)
945951
{
946952
/*
947953
* xmax is a multixact, so sanity-check the MXID. Note that we do this
948-
* prior to checking for HEAP_XMAX_INVALID or HEAP_XMAX_IS_LOCKED_ONLY.
949-
* This might therefore complain about things that wouldn't actually
950-
* be a problem during a normal scan, but eventually we're going to
951-
* have to freeze, and that process will ignore hint bits.
954+
* prior to checking for HEAP_XMAX_INVALID or
955+
* HEAP_XMAX_IS_LOCKED_ONLY. This might therefore complain about
956+
* things that wouldn't actually be a problem during a normal scan,
957+
* but eventually we're going to have to freeze, and that process will
958+
* ignore hint bits.
952959
*
953960
* Even if the MXID is out of range, we still know that the original
954961
* insert committed, so we can check the tuple itself. However, we
955962
* can't rule out the possibility that this tuple is dead, so don't
956963
* clear ctx->tuple_could_be_pruned. Possibly we should go ahead and
957964
* clear that flag anyway if HEAP_XMAX_INVALID is set or if
958-
* HEAP_XMAX_IS_LOCKED_ONLY is true, but for now we err on the side
959-
* of avoiding possibly-bogus complaints about missing TOAST entries.
965+
* HEAP_XMAX_IS_LOCKED_ONLY is true, but for now we err on the side of
966+
* avoiding possibly-bogus complaints about missing TOAST entries.
960967
*/
961968
xmax = HeapTupleHeaderGetRawXmax(tuphdr);
962969
switch (check_mxid_valid_in_rel(xmax, ctx))
@@ -1066,9 +1073,10 @@ check_tuple_visibility(HeapCheckContext *ctx)
10661073
* away depends on how old the deleting transaction is.
10671074
*/
10681075
ctx->tuple_could_be_pruned = TransactionIdPrecedes(xmax,
1069-
ctx->safe_xmin);
1076+
ctx->safe_xmin);
10701077
break;
10711078
case XID_ABORTED:
1079+
10721080
/*
10731081
* The delete aborted or crashed. The tuple is still live.
10741082
*/
@@ -1127,15 +1135,17 @@ check_tuple_visibility(HeapCheckContext *ctx)
11271135
break;
11281136

11291137
case XID_COMMITTED:
1138+
11301139
/*
11311140
* The delete committed. Whether the toast can be vacuumed away
11321141
* depends on how old the deleting transaction is.
11331142
*/
11341143
ctx->tuple_could_be_pruned = TransactionIdPrecedes(xmax,
1135-
ctx->safe_xmin);
1144+
ctx->safe_xmin);
11361145
break;
11371146

11381147
case XID_ABORTED:
1148+
11391149
/*
11401150
* The delete aborted or crashed. The tuple is still live.
11411151
*/
@@ -1248,6 +1258,7 @@ check_toast_tuple(HeapTuple toasttup, HeapCheckContext *ctx,
12481258
ta->toast_pointer.va_valueid,
12491259
chunk_seq, chunksize, expected_size));
12501260
}
1261+
12511262
/*
12521263
* Check the current attribute as tracked in ctx, recording any corruption
12531264
* found in ctx->tupstore.

contrib/amcheck/verify_nbtree.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
536536
ereport(DEBUG1,
537537
(errcode(ERRCODE_NO_DATA),
538538
errmsg_internal("harmless fast root mismatch in index \"%s\"",
539-
RelationGetRelationName(rel)),
539+
RelationGetRelationName(rel)),
540540
errdetail_internal("Fast root block %u (level %u) differs from true root block %u (level %u).",
541541
metad->btm_fastroot, metad->btm_fastlevel,
542542
metad->btm_root, metad->btm_level)));
@@ -722,7 +722,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
722722
ereport(DEBUG1,
723723
(errcode(ERRCODE_NO_DATA),
724724
errmsg_internal("block %u of index \"%s\" concurrently deleted",
725-
current, RelationGetRelationName(state->rel))));
725+
current, RelationGetRelationName(state->rel))));
726726
goto nextpage;
727727
}
728728
else if (nextleveldown.leftmost == InvalidBlockNumber)
@@ -918,7 +918,7 @@ bt_recheck_sibling_links(BtreeCheckState *state,
918918
Buffer newtargetbuf;
919919
Page page;
920920
BTPageOpaque opaque;
921-
BlockNumber newtargetblock;
921+
BlockNumber newtargetblock;
922922

923923
/* Couple locks in the usual order for nbtree: Left to right */
924924
lbuf = ReadBufferExtended(state->rel, MAIN_FORKNUM, leftcurrent,
@@ -980,7 +980,7 @@ bt_recheck_sibling_links(BtreeCheckState *state,
980980
ereport(DEBUG1,
981981
(errcode(ERRCODE_INTERNAL_ERROR),
982982
errmsg_internal("harmless concurrent page split detected in index \"%s\"",
983-
RelationGetRelationName(state->rel)),
983+
RelationGetRelationName(state->rel)),
984984
errdetail_internal("Block=%u new right sibling=%u original right sibling=%u.",
985985
leftcurrent, newtargetblock,
986986
state->targetblock)));
@@ -1599,7 +1599,7 @@ bt_right_page_check_scankey(BtreeCheckState *state)
15991599
ereport(DEBUG2,
16001600
(errcode(ERRCODE_NO_DATA),
16011601
errmsg_internal("level %u sibling page in block %u of index \"%s\" was found deleted or half dead",
1602-
opaque->btpo_level, targetnext, RelationGetRelationName(state->rel)),
1602+
opaque->btpo_level, targetnext, RelationGetRelationName(state->rel)),
16031603
errdetail_internal("Deleted page found when building scankey from right sibling.")));
16041604

16051605
targetnext = opaque->btpo_next;
@@ -1729,8 +1729,8 @@ bt_right_page_check_scankey(BtreeCheckState *state)
17291729
ereport(DEBUG2,
17301730
(errcode(ERRCODE_NO_DATA),
17311731
errmsg_internal("%s block %u of index \"%s\" has no first data item",
1732-
P_ISLEAF(opaque) ? "leaf" : "internal", targetnext,
1733-
RelationGetRelationName(state->rel))));
1732+
P_ISLEAF(opaque) ? "leaf" : "internal", targetnext,
1733+
RelationGetRelationName(state->rel))));
17341734
return NULL;
17351735
}
17361736

@@ -2278,7 +2278,7 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
22782278
ereport(DEBUG1,
22792279
(errcode(ERRCODE_NO_DATA),
22802280
errmsg_internal("harmless interrupted page split detected in index \"%s\"",
2281-
RelationGetRelationName(state->rel)),
2281+
RelationGetRelationName(state->rel)),
22822282
errdetail_internal("Block=%u level=%u left sibling=%u page lsn=%X/%X.",
22832283
blkno, opaque->btpo_level,
22842284
opaque->btpo_prev,

contrib/old_snapshot/time_mapping.c

+15-14
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
*/
2626
typedef struct
2727
{
28-
int current_index;
29-
int head_offset;
30-
TimestampTz head_timestamp;
31-
int count_used;
32-
TransactionId xid_by_minute[FLEXIBLE_ARRAY_MEMBER];
28+
int current_index;
29+
int head_offset;
30+
TimestampTz head_timestamp;
31+
int count_used;
32+
TransactionId xid_by_minute[FLEXIBLE_ARRAY_MEMBER];
3333
} OldSnapshotTimeMapping;
3434

3535
#define NUM_TIME_MAPPING_COLUMNS 3
@@ -53,7 +53,7 @@ pg_old_snapshot_time_mapping(PG_FUNCTION_ARGS)
5353

5454
if (SRF_IS_FIRSTCALL())
5555
{
56-
MemoryContext oldcontext;
56+
MemoryContext oldcontext;
5757

5858
funcctx = SRF_FIRSTCALL_INIT();
5959
oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
@@ -127,24 +127,25 @@ MakeOldSnapshotTimeMappingTupleDesc(void)
127127
static HeapTuple
128128
MakeOldSnapshotTimeMappingTuple(TupleDesc tupdesc, OldSnapshotTimeMapping *mapping)
129129
{
130-
Datum values[NUM_TIME_MAPPING_COLUMNS];
131-
bool nulls[NUM_TIME_MAPPING_COLUMNS];
132-
int array_position;
133-
TimestampTz timestamp;
130+
Datum values[NUM_TIME_MAPPING_COLUMNS];
131+
bool nulls[NUM_TIME_MAPPING_COLUMNS];
132+
int array_position;
133+
TimestampTz timestamp;
134134

135135
/*
136136
* Figure out the array position corresponding to the current index.
137137
*
138138
* Index 0 means the oldest entry in the mapping, which is stored at
139-
* mapping->head_offset. Index 1 means the next-oldest entry, which is a the
140-
* following index, and so on. We wrap around when we reach the end of the array.
139+
* mapping->head_offset. Index 1 means the next-oldest entry, which is a
140+
* the following index, and so on. We wrap around when we reach the end of
141+
* the array.
141142
*/
142143
array_position = (mapping->head_offset + mapping->current_index)
143144
% OLD_SNAPSHOT_TIME_MAP_ENTRIES;
144145

145146
/*
146-
* No explicit timestamp is stored for any entry other than the oldest one,
147-
* but each entry corresponds to 1-minute period, so we can just add.
147+
* No explicit timestamp is stored for any entry other than the oldest
148+
* one, but each entry corresponds to 1-minute period, so we can just add.
148149
*/
149150
timestamp = TimestampTzPlusMilliseconds(mapping->head_timestamp,
150151
mapping->current_index * 60000);

contrib/pg_stat_statements/pg_stat_statements.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -1074,9 +1074,10 @@ pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
10741074
* Force utility statements to get queryId zero. We do this even in cases
10751075
* where the statement contains an optimizable statement for which a
10761076
* queryId could be derived (such as EXPLAIN or DECLARE CURSOR). For such
1077-
* cases, runtime control will first go through ProcessUtility and then the
1078-
* executor, and we don't want the executor hooks to do anything, since we
1079-
* are already measuring the statement's costs at the utility level.
1077+
* cases, runtime control will first go through ProcessUtility and then
1078+
* the executor, and we don't want the executor hooks to do anything,
1079+
* since we are already measuring the statement's costs at the utility
1080+
* level.
10801081
*
10811082
* Note that this is only done if pg_stat_statements is enabled and
10821083
* configured to track utility statements, in the unlikely possibility

contrib/postgres_fdw/deparse.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,8 @@ rebuildInsertSql(StringInfo buf, char *orig_query,
17791779
int values_end_len, int num_cols,
17801780
int num_rows)
17811781
{
1782-
int i, j;
1782+
int i,
1783+
j;
17831784
int pindex;
17841785
bool first;
17851786

@@ -1790,8 +1791,8 @@ rebuildInsertSql(StringInfo buf, char *orig_query,
17901791
appendBinaryStringInfo(buf, orig_query, values_end_len);
17911792

17921793
/*
1793-
* Add records to VALUES clause (we already have parameters for the
1794-
* first row, so start at the right offset).
1794+
* Add records to VALUES clause (we already have parameters for the first
1795+
* row, so start at the right offset).
17951796
*/
17961797
pindex = num_cols + 1;
17971798
for (i = 0; i < num_rows; i++)

0 commit comments

Comments
 (0)