nocfbot-0012-Clarify-RPR_VARID_MAX-definition.txt

text/plain

Filename: nocfbot-0012-Clarify-RPR_VARID_MAX-definition.txt
Type: text/plain
Part: 11
Message: Re: Row pattern recognition
From f7d0cd30573e7ca2ab72c80a4ed6537b5451cdb4 Mon Sep 17 00:00:00 2001
From: Henson Choi <assam258@gmail.com>
Date: Fri, 20 Mar 2026 21:27:33 +0900
Subject: [PATCH] Clarify RPR_VARID_MAX definition in rpr.h

RPR_VARID_MAX = 251 allows varId 0 through 250, giving a maximum of
251 unique pattern variables. Values from 252 onward are reserved for
control elements (BEGIN, END, ALT, FIN). Add a comment explaining this
layout.
---
 src/include/optimizer/rpr.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/include/optimizer/rpr.h b/src/include/optimizer/rpr.h
index f93a128096b..e78092678bb 100644
--- a/src/include/optimizer/rpr.h
+++ b/src/include/optimizer/rpr.h
@@ -17,7 +17,11 @@
 #include "nodes/plannodes.h"
 
 /* Limits and special values */
-#define RPR_VARID_MAX		251 /* max pattern variables: 251 */
+/*
+ * Maximum number of unique pattern variables (varId 0 to RPR_VARID_MAX - 1).
+ * Values from RPR_VARID_BEGIN (252) onward are reserved for control elements.
+ */
+#define RPR_VARID_MAX		251
 #define RPR_QUANTITY_INF	INT32_MAX	/* unbounded quantifier */
 #define RPR_COUNT_MAX		INT32_MAX	/* max runtime count (NFA state) */
 #define RPR_ELEMIDX_MAX		INT16_MAX	/* max pattern elements */
-- 
2.50.1 (Apple Git-155)