v50-0009-define-walker-else.patch

application/octet-stream

Filename: v50-0009-define-walker-else.patch
Type: application/octet-stream
Part: 17
Message: Re: Row pattern recognition

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v50-0009
Subject: Replace a bare block with an else in the RPR DEFINE clause walker
File+
src/backend/parser/parse_rpr.c 7 8
From 80272b57dc87ffa9f87a74f61736146bf73cc347 Mon Sep 17 00:00:00 2001
From: Henson Choi <assam258@gmail.com>
Date: Wed, 17 Jun 2026 20:43:01 +0900
Subject: [PATCH v50 18/29] Replace a bare block with an else in the RPR DEFINE
 clause walker

define_walker() ended its phase handling with a bare braced block for
the DEFINE-body case, following two if blocks that respectively return
and raise an error.  Turn it into the else branch of an if / else if /
else chain.  No behavior change.
---
 src/backend/parser/parse_rpr.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/backend/parser/parse_rpr.c b/src/backend/parser/parse_rpr.c
index 116cd206e39..7c201d55164 100644
--- a/src/backend/parser/parse_rpr.c
+++ b/src/backend/parser/parse_rpr.c
@@ -515,8 +515,7 @@ define_walker(Node *node, void *context)
 			ctx->nav_count++;
 			return expression_tree_walker(node, define_walker, ctx);
 		}
-
-		if (ctx->phase == DEFINE_PHASE_NAV_OFFSET)
+		else if (ctx->phase == DEFINE_PHASE_NAV_OFFSET)
 		{
 			/*
 			 * A navigation offset must be a run-time constant, so it cannot
@@ -528,13 +527,13 @@ define_walker(Node *node, void *context)
 					errdetail("A navigation offset must be a run-time constant."),
 					parser_errposition(ctx->pstate, nav->location));
 		}
-
-		/*
-		 * PHASE_BODY: this is an outer nav at top level.  Walk arg first to
-		 * collect nesting / column-ref state, then validate and (for compound
-		 * forms) flatten, then walk offset(s).
-		 */
+		else
 		{
+			/*
+			 * PHASE_BODY: this is an outer nav at top level.  Walk arg first
+			 * to collect nesting / column-ref state, then validate and (for
+			 * compound forms) flatten, then walk offset(s).
+			 */
 			DefineWalkCtx saved = *ctx;
 			bool		outer_phys = (nav->kind == RPR_NAV_PREV ||
 									  nav->kind == RPR_NAV_NEXT);
-- 
2.50.1 (Apple Git-155)