Normalize PG18 error messages and window references in test outputs

pull/8344/head
Mehmet Yilmaz 2025-11-17 08:11:50 +00:00
parent c843cb2060
commit 643282df8c
3 changed files with 17 additions and 0 deletions

View File

@ -395,3 +395,14 @@ s/\<is referenced from table\>/is still referenced from table/g
s/^[[:space:]]*ERROR:[[:space:]]+subscription "[^"]+" could not connect to the publisher:[[:space:]]*/ERROR: could not connect to the publisher: /I s/^[[:space:]]*ERROR:[[:space:]]+subscription "[^"]+" could not connect to the publisher:[[:space:]]*/ERROR: could not connect to the publisher: /I
# PG18: drop verbose 'connection to server … failed:' preamble # PG18: drop verbose 'connection to server … failed:' preamble
s/^[[:space:]]*ERROR:[[:space:]]+could not connect to the publisher:[[:space:]]*connection to server .* failed:[[:space:]]*/ERROR: could not connect to the publisher: /I s/^[[:space:]]*ERROR:[[:space:]]+could not connect to the publisher:[[:space:]]*connection to server .* failed:[[:space:]]*/ERROR: could not connect to the publisher: /I
# PG18: replace named window refs like "OVER w1" with neutral "OVER (?)"
# this rule can be removed when PG18 is the minimum supported version
# only on Sort Key / Group Key / Output lines
# Sort Key
/^[[:space:]]*Sort Key:/ s/(OVER[[:space:]]+)w[0-9]+/\1(?)/g
# Group Key
/^[[:space:]]*Group Key:/ s/(OVER[[:space:]]+)w[0-9]+/\1(?)/g
# Output
/^[[:space:]]*Output:/ s/(OVER[[:space:]]+)w[0-9]+/\1(?)/g
# end PG18 window ref normalization

View File

@ -736,6 +736,9 @@ begin
IF ln ~ '^[[:space:]]*Index[[:space:]]+Searches:[[:space:]]*[0-9]+[[:space:]]*$' THEN IF ln ~ '^[[:space:]]*Index[[:space:]]+Searches:[[:space:]]*[0-9]+[[:space:]]*$' THEN
CONTINUE; CONTINUE;
END IF; END IF;
IF ln ~ '^[[:space:]]*Window:[[:space:]].*$' THEN -- e.g., "Window: w1 AS (...)"
CONTINUE;
END IF;
-- Replace any numeric word with just 'N' -- Replace any numeric word with just 'N'
ln := regexp_replace(ln, '-?\m\d+\M', 'N', 'g'); ln := regexp_replace(ln, '-?\m\d+\M', 'N', 'g');

View File

@ -767,6 +767,9 @@ begin
IF ln ~ '^[[:space:]]*Index[[:space:]]+Searches:[[:space:]]*[0-9]+[[:space:]]*$' THEN IF ln ~ '^[[:space:]]*Index[[:space:]]+Searches:[[:space:]]*[0-9]+[[:space:]]*$' THEN
CONTINUE; CONTINUE;
END IF; END IF;
IF ln ~ '^[[:space:]]*Window:[[:space:]].*$' THEN -- e.g., "Window: w1 AS (...)"
CONTINUE;
END IF;
-- Replace any numeric word with just 'N' -- Replace any numeric word with just 'N'
ln := regexp_replace(ln, '-?\m\d+\M', 'N', 'g'); ln := regexp_replace(ln, '-?\m\d+\M', 'N', 'g');