Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Fix typos in logical replication support for initial data copy.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 26 Mar 2017 21:44:35 +0000 (17:44 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 26 Mar 2017 21:44:35 +0000 (17:44 -0400)
Fix an incorrect assert condition (noted by Coverity), and spell the new
name of the function correctly.  Typos introduced in commit 7c4f52409.

Michael Paquier

src/backend/replication/logical/snapbuild.c
src/backend/replication/walsender.c
src/include/replication/snapbuild.h

index a73a7b98f97a1adbdd4b7db99f81e9fb31d15330..227960452d62c57d87b9b0ba38b81af4b4915564 100644 (file)
@@ -499,14 +499,14 @@ SnapBuildBuildSnapshot(SnapBuild *builder, TransactionId xid)
 }
 
 /*
- * Build the initial slot snapshot and convert it to normal snapshot that
+ * Build the initial slot snapshot and convert it to normal snapshot that
  * is understood by HeapTupleSatisfiesMVCC.
  *
  * The snapshot will be usable directly in current transaction or exported
  * for loading in different transaction.
  */
 Snapshot
-SnapBuildInitalSnapshot(SnapBuild *builder)
+SnapBuildInitialSnapshot(SnapBuild *builder)
 {
    Snapshot    snap;
    TransactionId xid;
@@ -514,7 +514,7 @@ SnapBuildInitalSnapshot(SnapBuild *builder)
    int         newxcnt = 0;
 
    Assert(!FirstSnapshotSet);
-   Assert(XactIsoLevel = XACT_REPEATABLE_READ);
+   Assert(XactIsoLevel == XACT_REPEATABLE_READ);
 
    if (builder->state != SNAPBUILD_CONSISTENT)
        elog(ERROR, "cannot build an initial slot snapshot before reaching a consistent state");
@@ -604,7 +604,7 @@ SnapBuildExportSnapshot(SnapBuild *builder)
    XactIsoLevel = XACT_REPEATABLE_READ;
    XactReadOnly = true;
 
-   snap = SnapBuildInitalSnapshot(builder);
+   snap = SnapBuildInitialSnapshot(builder);
 
    /*
     * now that we've built a plain snapshot, make it active and use the
index 59ae22df8c8d72305df977b0239774b1589d2599..040ad7b7371ebd9f38db921ce384afdc60b9c543 100644 (file)
@@ -938,7 +938,7 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
        {
            Snapshot    snap;
 
-           snap = SnapBuildInitalSnapshot(ctx->snapshot_builder);
+           snap = SnapBuildInitialSnapshot(ctx->snapshot_builder);
            RestoreTransactionSnapshot(snap, MyProc);
        }
 
index 091a9f91e36e64ef167969251f5378fdd9db3981..a8ae63116a63ab5b40f7c7c29eb6c37d3c1048f5 100644 (file)
@@ -59,7 +59,7 @@ extern void FreeSnapshotBuilder(SnapBuild *cache);
 
 extern void SnapBuildSnapDecRefcount(Snapshot snap);
 
-extern Snapshot SnapBuildInitalSnapshot(SnapBuild *builder);
+extern Snapshot SnapBuildInitialSnapshot(SnapBuild *builder);
 extern const char *SnapBuildExportSnapshot(SnapBuild *snapstate);
 extern void SnapBuildClearExportedSnapshot(void);