From 88d74aa37e95f34000ab19f704994da9e4c2e7f7 Mon Sep 17 00:00:00 2001
From: "dgrowley@gmail.com" <dgrowley@gmail.com>
Date: Mon, 9 Apr 2018 14:53:49 +1200
Subject: [PATCH 2/2] Fix misleading comment and typo

Clean up of 499be013de
---
 src/backend/executor/execPartition.c | 5 ++---
 src/include/partitioning/partprune.h | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/backend/executor/execPartition.c b/src/backend/executor/execPartition.c
index 50bea2c2ce..b9d5159354 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -1524,9 +1524,8 @@ ExecFindInitialMatchingSubPlans(PartitionPruneState *prunestate, int nsubnodes)
 
 	/*
 	 * Record that partition pruning has been performed for external params.
-	 * This partly also serves to ensure we never call this function twice
-	 * with the same input and also so that ExecFindMatchingSubPlans is aware
-	 * that pruning has already been performed for external Params.
+	 * These are not required again and NULLifying them helps ensure nothing
+	 * accidentally calls this function twice on the same PartitionPruneState.
 	 */
 	bms_free(prunestate->extparams);
 	prunestate->extparams = NULL;
diff --git a/src/include/partitioning/partprune.h b/src/include/partitioning/partprune.h
index f68b6c9935..2ae2fd16ed 100644
--- a/src/include/partitioning/partprune.h
+++ b/src/include/partitioning/partprune.h
@@ -40,7 +40,7 @@ typedef struct PartitionPruneContext
 
 	/*
 	 * Can be set when the context is used from the executor to allow params
-	 * found matching the partition key to be evaulated.
+	 * found matching the partition key to be evaluated.
 	 */
 	PlanState  *planstate;
 
-- 
2.16.2.windows.1

