]> granicus.if.org Git - postgresql/commitdiff
Fix assorted inconsistencies.
authorAmit Kapila <akapila@postgresql.org>
Sat, 8 Jun 2019 02:46:38 +0000 (08:16 +0530)
committerAmit Kapila <akapila@postgresql.org>
Sat, 8 Jun 2019 02:46:38 +0000 (08:16 +0530)
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

19 files changed:
src/backend/access/common/reloptions.c
src/backend/access/heap/heapam.c
src/backend/access/heap/heapam_handler.c
src/backend/access/heap/rewriteheap.c
src/backend/access/transam/xact.c
src/backend/access/transam/xlog.c
src/backend/access/transam/xloginsert.c
src/backend/commands/copy.c
src/backend/commands/tablecmds.c
src/backend/executor/execTuples.c
src/backend/executor/nodeModifyTable.c
src/backend/lib/integerset.c
src/backend/postmaster/postmaster.c
src/backend/storage/smgr/md.c
src/include/access/heapam.h
src/include/access/tableam.h
src/include/executor/executor.h
src/include/storage/sync.h
src/test/modules/test_integerset/test_integerset.c

index 4d0d24be0ba62c3101658949672123389f51e68f..de06c925743b8f8f551ec1f11ef12d57acb4cd7e 100644 (file)
@@ -52,9 +52,6 @@
  * (v) make sure the lock level is set correctly for that operation
  * (vi) don't forget to document the option
  *
- * Note that we don't handle "oids" in relOpts because it is handled by
- * interpretOidsOption().
- *
  * The default choice for any new option should be AccessExclusiveLock.
  * In some cases the lock level can be reduced from there, but the lock
  * level chosen should always conflict with itself to ensure that multiple
index bf82304b0ff50916dbd2092479dc35fc3ace0607..8ac0f8a5134b89fa1c361c0cd126e903ffed82c5 100644 (file)
@@ -239,8 +239,8 @@ initscan(HeapScanDesc scan, ScanKey key, bool keep_startblock)
         * behaviors, independently of the size of the table; also there is a GUC
         * variable that can disable synchronized scanning.)
         *
-        * Note that heap_parallelscan_initialize has a very similar test; if you
-        * change this, consider changing that one, too.
+        * Note that table_block_parallelscan_initialize has a very similar test;
+        * if you change this, consider changing that one, too.
         */
        if (!RelationUsesLocalBuffers(scan->rs_base.rs_rd) &&
                scan->rs_nblocks > NBuffers / 4)
@@ -1396,15 +1396,6 @@ heap_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *s
  * If the tuple is found but fails the time qual check, then false is returned
  * but tuple->t_data is left pointing to the tuple.
  *
- * keep_buf determines what is done with the buffer in the false-result cases.
- * When the caller specifies keep_buf = true, we retain the pin on the buffer
- * and return it in *userbuf (so the caller must eventually unpin it); when
- * keep_buf = false, the pin is released and *userbuf is set to InvalidBuffer.
- *
- * stats_relation is the relation to charge the heap_fetch operation against
- * for statistical purposes.  (This could be the heap rel itself, an
- * associated index, or NULL to not count the fetch at all.)
- *
  * heap_fetch does not follow HOT chains: only the exact TID requested will
  * be fetched.
  *
@@ -7085,7 +7076,7 @@ heap_compute_xid_horizon_for_tuples(Relation rel,
                         * Conjecture: if hitemid is dead then it had xids before the xids
                         * marked on LP_NORMAL items. So we just ignore this item and move
                         * onto the next, for the purposes of calculating
-                        * latestRemovedxids.
+                        * latestRemovedXid.
                         */
                }
                else
index 92ea1d163e6e9806973ec854967422b919e7f245..b7d2ddbbdcff3399eea669948ab7cda64ed20583 100644 (file)
@@ -286,7 +286,7 @@ heapam_tuple_insert_speculative(Relation relation, TupleTableSlot *slot,
 
 static void
 heapam_tuple_complete_speculative(Relation relation, TupleTableSlot *slot,
-                                                                 uint32 spekToken, bool succeeded)
+                                                                 uint32 specToken, bool succeeded)
 {
        bool            shouldFree = true;
        HeapTuple       tuple = ExecFetchSlotHeapTuple(slot, true, &shouldFree);
index 131ec7b8d7f55d3db9a44cf57e20f08cae836634..369694fa2e9bebb5f514c5187736a3267912417e 100644 (file)
@@ -350,7 +350,7 @@ end_heap_rewrite(RewriteState state)
         *
         * It's obvious that we must do this when not WAL-logging. It's less
         * obvious that we have to do it even if we did WAL-log the pages. The
-        * reason is the same as in tablecmds.c's copy_relation_data(): we're
+        * reason is the same as in storage.c's RelationCopyStorage(): we're
         * writing data that's not in shared buffers, and so a CHECKPOINT
         * occurring during the rewriteheap operation won't have fsync'd data we
         * wrote before the checkpoint.
index f1108ccc8b7d27c24888fed052a817325ee47849..821652b25b0ceca7cf969bfb2389c8564193b6b4 100644 (file)
@@ -91,8 +91,8 @@ int                   synchronous_commit = SYNCHRONOUS_COMMIT_ON;
  * need to return the same answers in the parallel worker as they would have
  * in the user backend, so we need some additional bookkeeping.
  *
- * XactTopTransactionId stores the XID of our toplevel transaction, which
- * will be the same as TopTransactionState.transactionId in an ordinary
+ * XactTopFullTransactionId stores the XID of our toplevel transaction, which
+ * will be the same as TopTransactionState.fullTransactionId in an ordinary
  * backend; but in a parallel backend, which does not have the entire
  * transaction state, it will instead be copied from the backend that started
  * the parallel operation.
index 1c7dd51b9f1c0b81d7235587fcf9eddfbc2dee81..e08320e8290893e120563b22bc971483690c0987 100644 (file)
@@ -314,8 +314,6 @@ static bool recoveryStopAfter;
  *
  * recoveryTargetTLI: the currently understood target timeline; changes
  *
- * recoveryTargetIsLatest: was the requested target timeline 'latest'?
- *
  * expectedTLEs: a list of TimeLineHistoryEntries for recoveryTargetTLI and the timelines of
  * its known parents, newest first (so recoveryTargetTLI is always the
  * first list member).  Only these TLIs are expected to be seen in the WAL
index d3c0a93a2e79dca5ef39076a21e21a48aaf9fedc..3ec67d468b5a22a0570f2d4f27fca70619070ab9 100644 (file)
@@ -1024,7 +1024,7 @@ log_newpage_buffer(Buffer buffer, bool page_std)
 /*
  * WAL-log a range of blocks in a relation.
  *
- * An image of all pages with block numbers 'startblk' <= X < 'endblock' is
+ * An image of all pages with block numbers 'startblk' <= X < 'endblk' is
  * written to the WAL. If the range is large, this is done in multiple WAL
  * records.
  *
index 2593732c16e11d4cb55416df46c26d553cdb1418..84c54fbc708d72ad41c5db6b6351bbf617bbba1e 100644 (file)
@@ -177,7 +177,6 @@ typedef struct CopyStateData
         */
        AttrNumber      num_defaults;
        FmgrInfo        oid_in_function;
-       Oid                     oid_typioparam;
        FmgrInfo   *in_functions;       /* array of input functions for each attrs */
        Oid                *typioparams;        /* array of element types for in_functions */
        int                *defmap;                     /* array of default att numbers */
index 2a72c1b501d678f27cdb096bd6782c9cf2176f5b..98519ef836cc9e1afb624757ec9fa10ca2f2c734 100644 (file)
@@ -379,7 +379,7 @@ static void ATExecCheckNotNull(AlteredTableInfo *tab, Relation rel,
                                                           const char *colName, LOCKMODE lockmode);
 static bool NotNullImpliedByRelConstraints(Relation rel, Form_pg_attribute attr);
 static bool ConstraintImpliedByRelConstraint(Relation scanrel,
-                                                                                        List *partConstraint, List *existedConstraints);
+                                                                                        List *testConstraint, List *provenConstraint);
 static ObjectAddress ATExecColumnDefault(Relation rel, const char *colName,
                                                                                 Node *newDefault, LOCKMODE lockmode);
 static ObjectAddress ATExecAddIdentity(Relation rel, const char *colName,
@@ -5522,8 +5522,8 @@ ATPrepAddColumn(List **wqueue, Relation rel, bool recurse, bool recursing,
 }
 
 /*
- * Add a column to a table; this handles the AT_AddOids cases as well.  The
- * return value is the address of the new column in the parent relation.
+ * Add a column to a table.  The return value is the address of the
+ * new column in the parent relation.
  */
 static ObjectAddress
 ATExecAddColumn(List **wqueue, AlteredTableInfo *tab, Relation rel,
index f785efae65deed057b0e65ac60ef906d526174c9..a5cb7bba0f84fc142587c56d93fd4625e70baedd 100644 (file)
@@ -1867,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);      /* checked in slot_getsomeattrs */
        Assert(attnum > 0);
 
        if (unlikely(attnum > slot->tts_tupleDescriptor->natts))
index a3c0e915434b330d8dbce83a2e9d7eecf138c4e1..24ed3718effd4444c88799f17b0666db77edcb06 100644 (file)
@@ -2316,7 +2316,9 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
         * verify that the proposed target relations are valid and open their
         * indexes for insertion of new index entries.  Note we *must* set
         * estate->es_result_relation_info correctly while we initialize each
-        * sub-plan; ExecContextForcesOids depends on that!
+        * sub-plan; external modules such as FDWs may depend on that (see
+        * contrib/postgres_fdw/postgres_fdw.c: postgresBeginDirectModify()
+        * as one example).
         */
        saved_resultRelInfo = estate->es_result_relation_info;
 
index 6921955f85ec8315c36b468938901aa2025a7e0a..6d51c7903e175eeb6d9d8c9127ebe2ab5b006cbb 100644 (file)
@@ -236,7 +236,7 @@ struct IntegerSet
         *
         * 'iter_values' is an array of integers ready to be returned to the
         * caller; 'iter_num_values' is the length of that array, and
-        * 'iter_valueno' is the next index.  'iter_node' and 'item_itemno' point
+        * 'iter_valueno' is the next index.  'iter_node' and 'iter_itemno' point
         * to the leaf node, and item within the leaf node, to get the next batch
         * of values from.
         *
index 8e098e401b9d139dd4b886d26a0009740d2cbd11..dd16938d9c7022ddd3edd085056545f674e76ff1 100644 (file)
@@ -404,7 +404,7 @@ static void BackendRun(Port *port) pg_attribute_noreturn();
 static void ExitPostmaster(int status) pg_attribute_noreturn();
 static int     ServerLoop(void);
 static int     BackendStartup(Port *port);
-static int     ProcessStartupPacket(Port *port, bool SSLdone);
+static int     ProcessStartupPacket(Port *port, bool secure_done);
 static void SendNegotiateProtocolVersion(List *unrecognized_protocol_options);
 static void processCancelRequest(Port *port, void *pkt);
 static int     initMasks(fd_set *rmask);
index bbcd18d52b3ed71d1752c1e48ca192f8875d30aa..64acc3fa433bfa8d019e30394454f2f2f9ef5dde 100644 (file)
@@ -921,7 +921,7 @@ register_dirty_segment(SMgrRelation reln, ForkNumber forknum, MdfdVec *seg)
 }
 
 /*
- * register_unlink() -- Schedule a file to be deleted after next checkpoint
+ * register_unlink_segment() -- Schedule a file to be deleted after next checkpoint
  */
 static void
 register_unlink_segment(RelFileNodeBackend rnode, ForkNumber forknum,
index b88bd8a4d73c2ee17140a03ebfabdaefae0523d8..dffb57bf11a40343b36d73d90801361dbeed5a98 100644 (file)
@@ -116,8 +116,6 @@ extern void heap_setscanlimits(TableScanDesc scan, BlockNumber startBlk,
 extern void heapgetpage(TableScanDesc scan, BlockNumber page);
 extern void heap_rescan(TableScanDesc scan, ScanKey key, bool set_params,
                                                bool allow_strat, bool allow_sync, bool allow_pagemode);
-extern void heap_rescan_set_params(TableScanDesc scan, ScanKey key,
-                                                                  bool allow_strat, bool allow_sync, bool allow_pagemode);
 extern void heap_endscan(TableScanDesc scan);
 extern HeapTuple heap_getnext(TableScanDesc scan, ScanDirection direction);
 extern bool heap_getnextslot(TableScanDesc sscan,
index c4e43b0e6e216b26e34ba7553915395527373137..585c120e18852a62ab632d255214abbe4044b161 100644 (file)
@@ -690,7 +690,7 @@ typedef struct TableAmRoutine
         * block using the TsmRoutine's NextSampleTuple() callback.
         *
         * The callback needs to perform visibility checks, and only return
-        * visible tuples. That obviously can mean calling NextSampletuple()
+        * visible tuples. That obviously can mean calling NextSampleTuple()
         * multiple times.
         *
         * The TsmRoutine interface assumes that there's a maximum offset on a
@@ -1596,7 +1596,7 @@ table_relation_size(Relation rel, ForkNumber forkNumber)
 }
 
 /*
- * table_needs_toast_table - does this relation need a toast table?
+ * table_relation_needs_toast_table - does this relation need a toast table?
  */
 static inline bool
 table_relation_needs_toast_table(Relation rel)
index 88134bcc7157cd014579fd48ba7d23ad3f50fe05..d056fd615130fcad497b71759728912992b3516b 100644 (file)
@@ -514,7 +514,6 @@ extern ExprContext *MakePerTupleExprContext(EState *estate);
 
 extern void ExecAssignExprContext(EState *estate, PlanState *planstate);
 extern TupleDesc ExecGetResultType(PlanState *planstate);
-extern TupleTableSlot ExecGetResultSlot(PlanState *planstate);
 extern const TupleTableSlotOps *ExecGetResultSlotOps(PlanState *planstate,
                                                                                                         bool *isfixed);
 extern void ExecAssignProjectionInfo(PlanState *planstate,
index 1e453a5b30a59790ac0f489f3c35480c9015def6..16428c5f5fb04a8ab70707140f1687e44fcd38cc 100644 (file)
@@ -44,7 +44,7 @@ typedef enum SyncRequestHandler
  */
 typedef struct FileTag
 {
-       int16           handler;                /* SyncRequstHandler value, saving space */
+       int16           handler;                /* SyncRequestHandler value, saving space */
        int16           forknum;                /* ForkNumber, saving space */
        RelFileNode rnode;
        uint32          segno;
index 346bb779bf33b112fb2925bcb56c41d796e674cc..15b9ce1ac3c01a3991015d97893eb568679ab573 100644 (file)
@@ -581,7 +581,7 @@ test_huge_distances(void)
                intset_add_member(intset, values[i]);
 
        /*
-        * Test iterset_is_member() around each of these values
+        * Test intset_is_member() around each of these values
         */
        for (int i = 0; i < num_values; i++)
        {