From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches
Date: Thu, 31 Mar 2022 06:09:34 -0400
Message-ID: <230c42b8-5758-3616-b4fd-df9191f0c273@dunslane.net> (raw)
In-Reply-To: <479467.1648689140@sss.pgh.pa.us>
References: <474104.1648685981@sss.pgh.pa.us>
<393B4FCB-1A6D-4993-B914-7E20A54863BE@dunslane.net>
<479467.1648689140@sss.pgh.pa.us>
On 3/30/22 21:12, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>>> On Mar 30, 2022, at 8:19 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> I think this means that its old Perl version misinterprets
>>> use parent -norequire, qw(PostgreSQL::Test::Cluster);
>>> as a request to include "parent.pm". Is there a more
>>> backwards-compatible way to spell that?
>> Not that I know of. Googling tells me it was a core module from 5.10.1. I can revert tomorrow if necessary :-(
I must have been half asleep when I posted this.
There are three ways out of this that I can see:
. carry a copy of parent.pm in src/test/perl (It's very small)
. use the older and heavier 'base' module which goes back to 5.004, and
does much the same thing (and a lot more)
. just do directly what parent.pm's import() does, as in the attached,
which I have tested down to version 10.
On the whole I think I prefer the last.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.comAttachments:cluster-parent-fix.patch (text/x-patch, 1.1K) downloaddiff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pmindex fa0ef12d72..1bfbb75b01 100644--- a/src/test/perl/PostgreSQL/Test/Cluster.pm+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm@@ -2918,7 +2918,10 @@ sub corrupt_page_checksum
package PostgreSQL::Test::Cluster::V_11; ## no critic (ProhibitMultiplePackages)
-use parent -norequire, qw(PostgreSQL::Test::Cluster);+# parent.pm is not present in all perl versions before 5.10.1, so instead+# do directly what it would do for this:+# use parent -norequire, qw(PostgreSQL::Test::Cluster);+push @PostgreSQL::Test::Cluster::V_11::ISA, 'PostgreSQL::Test::Cluster';
# https://www.postgresql.org/docs/11/release-11.html
@@ -2945,7 +2948,8 @@ sub init
package PostgreSQL::Test::Cluster::V_10; ## no critic (ProhibitMultiplePackages)
-use parent -norequire, qw(PostgreSQL::Test::Cluster::V_11);+# use parent -norequire, qw(PostgreSQL::Test::Cluster::V_11);+push @PostgreSQL::Test::Cluster::V_10::ISA, 'PostgreSQL::Test::Cluster::V_11';
# https://www.postgresql.org/docs/10/release-10.html
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andrew@dunslane.net, tgl@sss.pgh.pa.us
Subject: Re: pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches
In-Reply-To: <230c42b8-5758-3616-b4fd-df9191f0c273@dunslane.net>
References: <474104.1648685981@sss.pgh.pa.us> <393B4FCB-1A6D-4993-B914-7E20A54863BE@dunslane.net> <479467.1648689140@sss.pgh.pa.us> <230c42b8-5758-3616-b4fd-df9191f0c273@dunslane.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox