From: Tom Lane Date: Fri, 28 Feb 2025 20:20:22 +0000 (-0500) Subject: Tweak regex to avoid a bug in Perl 5.16.3. X-Git-Tag: REL_18_BETA1~722 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b49392b270b4ac0b9f5c210e2a503546841e832;p=thirdparty%2Fpostgresql.git Tweak regex to avoid a bug in Perl 5.16.3. For some reason, 5.16.3 (and perhaps slightly earlier/later versions) go into an infinite loop with the version-replacement regex installed by commit fc0d0ce97. We can work around that by using an explicit "\n" instead of the line-start metacharacter "^". Reported-by: Sami Imseih Discussion: https://postgr.es/m/CAA5RZ0u9dV3CdKqkqdusA_RdvBkwWe0c0rxcFWj++VYoutFYSw@mail.gmail.com --- diff --git a/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm b/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm index ec874852d12..81a8f44aa9f 100644 --- a/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm +++ b/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm @@ -296,7 +296,7 @@ sub adjust_old_dumpfile # Same with version argument to pg_restore_relation_stats() or # pg_restore_attribute_stats(). - $dump =~ s {(^\s+'version',) '\d+'::integer,$} + $dump =~ s {\n(\s+'version',) '\d+'::integer,$} {$1 '000000'::integer,}mg; if ($old_version < 16) @@ -645,7 +645,7 @@ sub adjust_new_dumpfile # Same with version argument to pg_restore_relation_stats() or # pg_restore_attribute_stats(). - $dump =~ s {(^\s+'version',) '\d+'::integer,$} + $dump =~ s {\n(\s+'version',) '\d+'::integer,$} {$1 '000000'::integer,}mg; # pre-v16 dumps do not know about XMLSERIALIZE(NO INDENT).