Hi Tatsuo,

Thanks for rebasing to v43!

I noticed the Cirrus CI 32-bit build (test_world_32) failed on three
tests, all due to the same root cause in rpr_explain.out:

  Sort Method: quicksort  Memory: 27kB  (expected, 64-bit)
  Sort Method: quicksort  Memory: 22kB  (actual, 32-bit)

The rpr_explain_filter() function was already normalizing the RPR
Storage memory values, but missed the Sort node's "Memory: NNkB"
which also varies between 32-bit and 64-bit due to pointer/struct
size differences.

The attached incremental patch adds Sort Method memory normalization
to rpr_explain_filter(), using the same approach as the existing
Storage and Maximum Storage filters.

> The node serialization functions (141 lines, 0% coverage) are the
> > largest untested area.  I'm not sure how to trigger these paths
> > in the regression test framework.  Any suggestions?
>
> I think we can leave it as it is, until reluctant quantifier is
> implemented.
>

Agreed.


> > I'll send a separate email within a few days listing the FIXME
> > issues and other unresolved items from the mailing list discussion
> > for your review.
>
> Looking forward to reading your email.


Best regards,
Henson
diff --git a/src/test/regress/expected/rpr_explain.out 
b/src/test/regress/expected/rpr_explain.out
index f23d06f6d59..bfe4ee2ba7d 100644
--- a/src/test/regress/expected/rpr_explain.out
+++ b/src/test/regress/expected/rpr_explain.out
@@ -33,7 +33,7 @@
 --   DEFINE Expression Variations
 --   Large Scale Statistics Verification
 -- ============================================================
--- Filter function to normalize Storage memory values only (not NFA 
statistics).
+-- Filter function to normalize platform-dependent memory values (not NFA 
statistics).
 -- NFA statistics should not change between platforms; if they do, it could
 -- indicate issues such as uninitialized memory access.
 -- Works for text, JSON, and XML formats.
@@ -45,7 +45,7 @@ declare
 begin
     for ln in execute $1
     loop
-        -- Normalize memory size in Storage line only (platform-dependent)
+        -- Normalize platform-dependent memory values
         -- Keep NFA statistics numbers unchanged (they are test assertions)
 
         -- Text format: "Storage: Memory  Maximum Storage: 18kB"
@@ -63,6 +63,11 @@ begin
             ln := regexp_replace(ln, '<Maximum-Storage>\d+</Maximum-Storage>', 
'<Maximum-Storage>0</Maximum-Storage>', 'g');
         end if;
 
+        -- Sort Method memory is platform-dependent (32-bit vs 64-bit)
+        if ln ~ 'Sort Method:.*Memory:' then
+            ln := regexp_replace(ln, 'Memory: \d+kB', 'Memory: NkB');
+        end if;
+
         return next ln;
     end loop;
 end;
@@ -1625,7 +1630,7 @@ WINDOW w AS (
    NFA: 54 absorbed (len 1/1/1.0), 18 skipped (len 1/1/1.0)
    ->  Sort (actual rows=90.00 loops=1)
          Sort Key: p.p
-         Sort Method: quicksort  Memory: 27kB
+         Sort Method: quicksort  Memory: NkB
          ->  Nested Loop (actual rows=90.00 loops=1)
                ->  Function Scan on generate_series p (actual rows=3.00 
loops=1)
                ->  Function Scan on generate_series v (actual rows=30.00 
loops=3)
@@ -1682,7 +1687,7 @@ WINDOW w AS (
    NFA: 19 absorbed (len 1/1/1.0), 5 skipped (len 1/1/1.0)
    ->  Sort (actual rows=50.00 loops=1)
          Sort Key: (CASE WHEN (v.v <= 25) THEN 1 ELSE 2 END)
-         Sort Method: quicksort  Memory: 26kB
+         Sort Method: quicksort  Memory: NkB
          ->  Function Scan on generate_series v (actual rows=50.00 loops=1)
 (12 rows)
 
diff --git a/src/test/regress/sql/rpr_explain.sql 
b/src/test/regress/sql/rpr_explain.sql
index f8c8f62e594..ea8c39b991e 100644
--- a/src/test/regress/sql/rpr_explain.sql
+++ b/src/test/regress/sql/rpr_explain.sql
@@ -34,7 +34,7 @@
 --   Large Scale Statistics Verification
 -- ============================================================
 
--- Filter function to normalize Storage memory values only (not NFA 
statistics).
+-- Filter function to normalize platform-dependent memory values (not NFA 
statistics).
 -- NFA statistics should not change between platforms; if they do, it could
 -- indicate issues such as uninitialized memory access.
 -- Works for text, JSON, and XML formats.
@@ -46,7 +46,7 @@ declare
 begin
     for ln in execute $1
     loop
-        -- Normalize memory size in Storage line only (platform-dependent)
+        -- Normalize platform-dependent memory values
         -- Keep NFA statistics numbers unchanged (they are test assertions)
 
         -- Text format: "Storage: Memory  Maximum Storage: 18kB"
@@ -64,6 +64,11 @@ begin
             ln := regexp_replace(ln, '<Maximum-Storage>\d+</Maximum-Storage>', 
'<Maximum-Storage>0</Maximum-Storage>', 'g');
         end if;
 
+        -- Sort Method memory is platform-dependent (32-bit vs 64-bit)
+        if ln ~ 'Sort Method:.*Memory:' then
+            ln := regexp_replace(ln, 'Memory: \d+kB', 'Memory: NkB');
+        end if;
+
         return next ln;
     end loop;
 end;

Reply via email to