From 86b5bc6a2018a0c3b2d925430e0ca7ffbd041c12 Mon Sep 17 00:00:00 2001 From: Mehmet YILMAZ Date: Thu, 21 Aug 2025 17:47:46 +0300 Subject: [PATCH] Normalize Actual Rows output in regression tests for PG18 compatibility (#8141) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DESCRIPTION: Normalize Actual Rows output in regression tests for PG18 compatibility PostgreSQL 18 changed `EXPLAIN ANALYZE` to always print fractional row counts (e.g. `1.00` instead of `1`). https://github.com/postgres/postgres/commit/95dbd827f2edc4d10bebd7e840a0bd6782cf69b7 This caused diffs across multiple output formats in Citus regression tests: * Text EXPLAIN: `actual rows=50.00` vs `actual rows=50` * YAML: `Actual Rows: 1.00` vs `Actual Rows: 1` * XML: `1.00` vs `1` * JSON: `"Actual Rows": 1.00` vs `"Actual Rows": 1` * Placeholders: `rows=N.N` vs `rows=N` This patch extends `normalize.sed` to strip trailing `.0…` from `Actual Rows` in all supported formats and collapses placeholder values back to `N`. With these changes, regression tests produce stable output across PG15–PG18. No functional changes to Citus itself — only test normalization was updated. --- src/test/regress/bin/normalize.sed | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/test/regress/bin/normalize.sed b/src/test/regress/bin/normalize.sed index 38fd45837..91484dc75 100644 --- a/src/test/regress/bin/normalize.sed +++ b/src/test/regress/bin/normalize.sed @@ -326,8 +326,23 @@ s/\| CHECK ([a-zA-Z])(.*)/| CHECK \(\1\2\)/g /DEBUG: drop auto-cascades to type [a-zA-Z_]*.pg_temp_[0-9]*/d -# pg18 change: strip trailing “.00” (or “.0…”) from actual rows counts -s/(actual rows=[0-9]+)\.[0-9]+/\1/g +# PG18 change: strip trailing ".0..." from Actual Rows across formats +# Text EXPLAIN (simple case: "actual rows=50.00") +s/(actual[[:space:]]*rows[[:space:]]*[=:][[:space:]]*)([0-9]+)\.0+/\1\2/gI +# Text EXPLAIN (inside "(actual time=... rows=50.00 ...)") +s/(actual[^)]*rows[[:space:]]*=[[:space:]]*)([0-9]+)\.0+/\1\2/gI +# YAML (e.g., "Actual Rows: 1.00") +s/(Actual[[:space:]]+Rows:[[:space:]]*[0-9]+)\.0+/\1/gI +# XML (e.g., "1.00") +s/([0-9]+)\.0+(<\/Actual-Rows>)/\1\2/g +# JSON (e.g., '"Actual Rows": 1.00') +s/("Actual[[:space:]]+Rows":[[:space:]]*[0-9]+)\.0+/\1/gI +# JSON placeholder cleanup: '"Actual Rows": N.0...' -> N +s/("Actual[[:space:]]+Rows":[[:space:]]*)N\.N/\1N/gI +# Collapse placeholder in text EXPLAIN: "rows=N.N" -> "rows=N" +s/(rows[[:space:]]*=[[:space:]]*)N\.N/\1N/gI +# YAML placeholder: "Actual Rows: N.N" -> "Actual Rows: N" +s/(Actual[[:space:]]+Rows:[[:space:]]*)N\.N/\1N/gI # pg18 “Disabled” change start # ignore any “Disabled:” lines in test output