nocfbot-0060-Fix-outdated-function-and-file-references-in-row-.txt
text/plain
Filename: nocfbot-0060-Fix-outdated-function-and-file-references-in-row-.txt
Type: text/plain
Part: 59
Message:
Re: Row pattern recognition
From 071126a8559aceea9299a2801a78f241777071dd Mon Sep 17 00:00:00 2001
From: Henson Choi <assam258@gmail.com>
Date: Mon, 8 Jun 2026 11:46:56 +0900
Subject: [PATCH 60/68] Fix outdated function and file references in row
pattern recognition docs
Two comments in rpr_nfa.sql attributed nfa_advance_begin/end to
nodeWindowAgg.c, but both are defined in execRPR.c. README.rpr referred to a
nonexistent compute_nav_offsets; the planner routine that computes the trim
offsets is compute_define_metadata in createplan.c. These are comment and
documentation fixes only, with no behavior change; the rpr_nfa expected output
is updated to match the corrected comment.
---
src/backend/executor/README.rpr | 4 ++--
src/test/regress/expected/rpr_nfa.out | 4 ++--
src/test/regress/sql/rpr_nfa.sql | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/backend/executor/README.rpr b/src/backend/executor/README.rpr
index df574a0a6f4..c1822d8240b 100644
--- a/src/backend/executor/README.rpr
+++ b/src/backend/executor/README.rpr
@@ -667,7 +667,7 @@ VI-5. Tuplestore Mark and Trim (nodeWindowAgg.c)
Navigation functions require access to past rows via the tuplestore.
To allow tuplestore_trim() to free rows that are no longer reachable,
-the planner computes two offsets (see compute_nav_offsets):
+the planner computes two offsets (see compute_define_metadata):
navMaxOffset (Nav Mark Lookback):
Maximum backward reach from currentpos. Contributed by PREV,
@@ -1499,7 +1499,7 @@ Appendix A. Key Function Index
ExecRPRFinalizeAllContexts execRPR.c Partition-end finalize
ExecRPRRecordContextSuccess execRPR.c Stats: match success
ExecRPRRecordContextFailure execRPR.c Stats: match failure
- compute_nav_offsets createplan.c Trim offset computation
+ compute_define_metadata createplan.c Trim offset computation
Appendix B. Data Structure Relationship Diagram
============================================================================
diff --git a/src/test/regress/expected/rpr_nfa.out b/src/test/regress/expected/rpr_nfa.out
index 3b9975a83df..d7146168f2b 100644
--- a/src/test/regress/expected/rpr_nfa.out
+++ b/src/test/regress/expected/rpr_nfa.out
@@ -1357,7 +1357,7 @@ WINDOW w AS (
-- Reluctant optional group skip-to-FIN
-- When a reluctant optional group's skip path reaches FIN, the group
--- entry path is abandoned (nodeWindowAgg.c nfa_advance_begin).
+-- entry path is abandoned (execRPR.c nfa_advance_begin).
-- Pattern: C (A B)?? -- after C matches, the reluctant group (A B)??
-- prefers to skip. Skip goes to FIN (group is last element), so
-- the match completes with just C.
@@ -3364,7 +3364,7 @@ WINDOW w AS (
-- Nested END->END fast-forward
-- When an inner group has a nullable body and count < min, the
-- fast-forward path exits through the outer END, incrementing
--- the outer group's count (nodeWindowAgg.c nfa_advance_end).
+-- the outer group's count (execRPR.c nfa_advance_end).
-- Pattern: ((A?){2,3}){2,3} -- nested groups, neither collapses
-- because the optimizer cannot safely multiply non-exact quantifiers.
-- Data has no A rows, forcing all-empty iterations via fast-forward.
diff --git a/src/test/regress/sql/rpr_nfa.sql b/src/test/regress/sql/rpr_nfa.sql
index 61072d1d6f1..8daa0a73725 100644
--- a/src/test/regress/sql/rpr_nfa.sql
+++ b/src/test/regress/sql/rpr_nfa.sql
@@ -968,7 +968,7 @@ WINDOW w AS (
-- Reluctant optional group skip-to-FIN
-- When a reluctant optional group's skip path reaches FIN, the group
--- entry path is abandoned (nodeWindowAgg.c nfa_advance_begin).
+-- entry path is abandoned (execRPR.c nfa_advance_begin).
-- Pattern: C (A B)?? -- after C matches, the reluctant group (A B)??
-- prefers to skip. Skip goes to FIN (group is last element), so
-- the match completes with just C.
@@ -2406,7 +2406,7 @@ WINDOW w AS (
-- Nested END->END fast-forward
-- When an inner group has a nullable body and count < min, the
-- fast-forward path exits through the outer END, incrementing
--- the outer group's count (nodeWindowAgg.c nfa_advance_end).
+-- the outer group's count (execRPR.c nfa_advance_end).
-- Pattern: ((A?){2,3}){2,3} -- nested groups, neither collapses
-- because the optimizer cannot safely multiply non-exact quantifiers.
-- Data has no A rows, forcing all-empty iterations via fast-forward.
--
2.50.1 (Apple Git-155)