From 1edbbba56238e736700720744bb4e98e8e771be6 Mon Sep 17 00:00:00 2001
From: Greg Nancarrow <gregn4422@gmail.com>
Date: Mon, 10 May 2021 19:00:17 +1000
Subject: [PATCH] Change one instance of WHILE in executor code, that should
 really just be an IF condition.

The existing WHILE loop has an unconditional RETURN at the end of the code block
and functions the same as an IF condition, so should be changed to IF for
clarity.
---
 src/backend/executor/nodeResult.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/executor/nodeResult.c b/src/backend/executor/nodeResult.c
index 1762b87c99..0946af0a54 100644
--- a/src/backend/executor/nodeResult.c
+++ b/src/backend/executor/nodeResult.c
@@ -103,7 +103,7 @@ ExecResult(PlanState *pstate)
 	 * called, OR that we failed the constant qual check. Either way, now we
 	 * are through.
 	 */
-	while (!node->rs_done)
+	if (!node->rs_done)
 	{
 		outerPlan = outerPlanState(node);
 
-- 
2.27.0

