Skip to content

Commit 92c4abc

Browse files
author
Amit Kapila
committed
Fix assorted inconsistencies.
There were a number of issues in the recent commits which include typos, code and comments mismatch, leftover function declarations. Fix them. Reported-by: Alexander Lakhin Author: Alexander Lakhin, Amit Kapila and Amit Langote Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/ef0c0232-0c1d-3a35-63d4-0ebd06e31387@gmail.com
1 parent 35b2d4b commit 92c4abc

File tree

19 files changed

+22
-38
lines changed

19 files changed

+22
-38
lines changed

src/backend/access/common/reloptions.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@
5252
* (v) make sure the lock level is set correctly for that operation
5353
* (vi) don't forget to document the option
5454
*
55-
* Note that we don't handle "oids" in relOpts because it is handled by
56-
* interpretOidsOption().
57-
*
5855
* The default choice for any new option should be AccessExclusiveLock.
5956
* In some cases the lock level can be reduced from there, but the lock
6057
* level chosen should always conflict with itself to ensure that multiple

src/backend/access/heap/heapam.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ initscan(HeapScanDesc scan, ScanKey key, bool keep_startblock)
239239
* behaviors, independently of the size of the table; also there is a GUC
240240
* variable that can disable synchronized scanning.)
241241
*
242-
* Note that heap_parallelscan_initialize has a very similar test; if you
243-
* change this, consider changing that one, too.
242+
* Note that table_block_parallelscan_initialize has a very similar test;
243+
* if you change this, consider changing that one, too.
244244
*/
245245
if (!RelationUsesLocalBuffers(scan->rs_base.rs_rd) &&
246246
scan->rs_nblocks > NBuffers / 4)
@@ -1396,15 +1396,6 @@ heap_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *s
13961396
* If the tuple is found but fails the time qual check, then false is returned
13971397
* but tuple->t_data is left pointing to the tuple.
13981398
*
1399-
* keep_buf determines what is done with the buffer in the false-result cases.
1400-
* When the caller specifies keep_buf = true, we retain the pin on the buffer
1401-
* and return it in *userbuf (so the caller must eventually unpin it); when
1402-
* keep_buf = false, the pin is released and *userbuf is set to InvalidBuffer.
1403-
*
1404-
* stats_relation is the relation to charge the heap_fetch operation against
1405-
* for statistical purposes. (This could be the heap rel itself, an
1406-
* associated index, or NULL to not count the fetch at all.)
1407-
*
14081399
* heap_fetch does not follow HOT chains: only the exact TID requested will
14091400
* be fetched.
14101401
*
@@ -7085,7 +7076,7 @@ heap_compute_xid_horizon_for_tuples(Relation rel,
70857076
* Conjecture: if hitemid is dead then it had xids before the xids
70867077
* marked on LP_NORMAL items. So we just ignore this item and move
70877078
* onto the next, for the purposes of calculating
7088-
* latestRemovedxids.
7079+
* latestRemovedXid.
70897080
*/
70907081
}
70917082
else

src/backend/access/heap/heapam_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ heapam_tuple_insert_speculative(Relation relation, TupleTableSlot *slot,
286286

287287
static void
288288
heapam_tuple_complete_speculative(Relation relation, TupleTableSlot *slot,
289-
uint32 spekToken, bool succeeded)
289+
uint32 specToken, bool succeeded)
290290
{
291291
bool shouldFree = true;
292292
HeapTuple tuple = ExecFetchSlotHeapTuple(slot, true, &shouldFree);

src/backend/access/heap/rewriteheap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ end_heap_rewrite(RewriteState state)
350350
*
351351
* It's obvious that we must do this when not WAL-logging. It's less
352352
* obvious that we have to do it even if we did WAL-log the pages. The
353-
* reason is the same as in tablecmds.c's copy_relation_data(): we're
353+
* reason is the same as in storage.c's RelationCopyStorage(): we're
354354
* writing data that's not in shared buffers, and so a CHECKPOINT
355355
* occurring during the rewriteheap operation won't have fsync'd data we
356356
* wrote before the checkpoint.

src/backend/access/transam/xact.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ int synchronous_commit = SYNCHRONOUS_COMMIT_ON;
9191
* need to return the same answers in the parallel worker as they would have
9292
* in the user backend, so we need some additional bookkeeping.
9393
*
94-
* XactTopTransactionId stores the XID of our toplevel transaction, which
95-
* will be the same as TopTransactionState.transactionId in an ordinary
94+
* XactTopFullTransactionId stores the XID of our toplevel transaction, which
95+
* will be the same as TopTransactionState.fullTransactionId in an ordinary
9696
* backend; but in a parallel backend, which does not have the entire
9797
* transaction state, it will instead be copied from the backend that started
9898
* the parallel operation.

src/backend/access/transam/xlog.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,6 @@ static bool recoveryStopAfter;
314314
*
315315
* recoveryTargetTLI: the currently understood target timeline; changes
316316
*
317-
* recoveryTargetIsLatest: was the requested target timeline 'latest'?
318-
*
319317
* expectedTLEs: a list of TimeLineHistoryEntries for recoveryTargetTLI and the timelines of
320318
* its known parents, newest first (so recoveryTargetTLI is always the
321319
* first list member). Only these TLIs are expected to be seen in the WAL

src/backend/access/transam/xloginsert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ log_newpage_buffer(Buffer buffer, bool page_std)
10241024
/*
10251025
* WAL-log a range of blocks in a relation.
10261026
*
1027-
* An image of all pages with block numbers 'startblk' <= X < 'endblock' is
1027+
* An image of all pages with block numbers 'startblk' <= X < 'endblk' is
10281028
* written to the WAL. If the range is large, this is done in multiple WAL
10291029
* records.
10301030
*

src/backend/commands/copy.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ typedef struct CopyStateData
177177
*/
178178
AttrNumber num_defaults;
179179
FmgrInfo oid_in_function;
180-
Oid oid_typioparam;
181180
FmgrInfo *in_functions; /* array of input functions for each attrs */
182181
Oid *typioparams; /* array of element types for in_functions */
183182
int *defmap; /* array of default att numbers */

src/backend/commands/tablecmds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static void ATExecCheckNotNull(AlteredTableInfo *tab, Relation rel,
379379
const char *colName, LOCKMODE lockmode);
380380
static bool NotNullImpliedByRelConstraints(Relation rel, Form_pg_attribute attr);
381381
static bool ConstraintImpliedByRelConstraint(Relation scanrel,
382-
List *partConstraint, List *existedConstraints);
382+
List *testConstraint, List *provenConstraint);
383383
static ObjectAddress ATExecColumnDefault(Relation rel, const char *colName,
384384
Node *newDefault, LOCKMODE lockmode);
385385
static ObjectAddress ATExecAddIdentity(Relation rel, const char *colName,
@@ -5522,8 +5522,8 @@ ATPrepAddColumn(List **wqueue, Relation rel, bool recurse, bool recursing,
55225522
}
55235523

55245524
/*
5525-
* Add a column to a table; this handles the AT_AddOids cases as well. The
5526-
* return value is the address of the new column in the parent relation.
5525+
* Add a column to a table. The return value is the address of the
5526+
* new column in the parent relation.
55275527
*/
55285528
static ObjectAddress
55295529
ATExecAddColumn(List **wqueue, AlteredTableInfo *tab, Relation rel,

src/backend/executor/execTuples.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ void
18671867
slot_getsomeattrs_int(TupleTableSlot *slot, int attnum)
18681868
{
18691869
/* Check for caller errors */
1870-
Assert(slot->tts_nvalid < attnum); /* slot_getsomeattr checked */
1870+
Assert(slot->tts_nvalid < attnum); /* checked in slot_getsomeattrs */
18711871
Assert(attnum > 0);
18721872

18731873
if (unlikely(attnum > slot->tts_tupleDescriptor->natts))

0 commit comments

Comments
 (0)