0011-use-empty-match-term.txt

text/plain

Filename: 0011-use-empty-match-term.txt
Type: text/plain
Part: 10
Message: Re: Row pattern recognition
From 352b918acb2dc10bd55eaf0471f1f5c60b8a1791 Mon Sep 17 00:00:00 2001
From: Henson Choi <assam258@gmail.com>
Date: Sun, 8 Mar 2026 19:17:31 +0900
Subject: [PATCH 11/12] Use SQL standard term "empty match" in RPR comments

---
 src/backend/executor/nodeWindowAgg.c  | 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/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c
index 3075c51789c..76c1a6bebef 100644
--- a/src/backend/executor/nodeWindowAgg.c
+++ b/src/backend/executor/nodeWindowAgg.c
@@ -5008,12 +5008,12 @@ register_result:
  *   handles nested groups like "((A|B)+)+" correctly - exiting the inner
  *   group counts as one iteration of the outer group.
  *
- * - Zero-length match handling: The initial advance uses currentPos =
+ * - Empty match handling: The initial advance uses currentPos =
  *   startPos - 1 (before any row is consumed). If FIN is reached via
  *   epsilon transitions alone, matchEndRow = startPos - 1 < matchStartRow,
  *   resulting in UNMATCHED. For reluctant min=0 patterns (A*?, A??),
  *   the skip path reaches FIN first and early termination prunes enter
- *   paths, yielding an immediate zero-length (unmatched) result. For
+ *   paths, yielding an immediate empty (unmatched) result. For
  *   greedy patterns (A*), the enter path adds VAR states first, then
  *   the skip FIN is recorded but VAR states survive for later matching.
  *
diff --git a/src/test/regress/expected/rpr_nfa.out b/src/test/regress/expected/rpr_nfa.out
index c8464e8fcf4..7b5a17fb671 100644
--- a/src/test/regress/expected/rpr_nfa.out
+++ b/src/test/regress/expected/rpr_nfa.out
@@ -4239,8 +4239,8 @@ WINDOW w AS (
 (6 rows)
 
 -- (A? B?){2,3}: pure empty body (nothing matches)
--- XXX: All NULL: same issue as test_728_min2 (initialAdvance blocks FIN
--- for zero-length matches at context start)
+-- XXX: All NULL: same issue as test_728_min2 (empty match at context
+-- start yields UNMATCHED via startPos-1 initial advance)
 WITH test_728_multi_empty AS (
     SELECT * FROM (VALUES
         (1, ARRAY['C']),
diff --git a/src/test/regress/sql/rpr_nfa.sql b/src/test/regress/sql/rpr_nfa.sql
index c0f4dfa1248..5edcb3357e6 100644
--- a/src/test/regress/sql/rpr_nfa.sql
+++ b/src/test/regress/sql/rpr_nfa.sql
@@ -3197,8 +3197,8 @@ WINDOW w AS (
 );
 
 -- (A? B?){2,3}: pure empty body (nothing matches)
--- XXX: All NULL: same issue as test_728_min2 (initialAdvance blocks FIN
--- for zero-length matches at context start)
+-- XXX: All NULL: same issue as test_728_min2 (empty match at context
+-- start yields UNMATCHED via startPos-1 initial advance)
 WITH test_728_multi_empty AS (
     SELECT * FROM (VALUES
         (1, ARRAY['C']),
-- 
2.50.1 (Apple Git-155)