Re: Extend compatibility of PostgreSQL::Test::Cluster

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Extend compatibility of PostgreSQL::Test::Cluster
Дата
Msg-id 3e9cd86a-712c-28a2-92ae-34f4d6589aec@dunslane.net
обсуждение исходный текст
Ответ на Re: Extend compatibility of PostgreSQL::Test::Cluster  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: Extend compatibility of PostgreSQL::Test::Cluster  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On 12/31/21 11:22, Andrew Dunstan wrote:
> On 12/31/21 11:20, Dagfinn Ilmari Mannsåker wrote:
>> Andrew Dunstan <andrew@dunslane.net> writes:
>>
>>> +        my $subclass = __PACKAGE__ . "::V_$maj";
>>> +        bless $node, $subclass;
>>> +        unless ($node->isa(__PACKAGE__))
>>> +        {
>>> +            # It's not a subclass, so re-bless back into the main package
>>> +            bless($node, __PACKAGE__);
>>> +            carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
>>> +        }
>> The ->isa() method works on package names as well as blessed objects, so
>> the back-and-forth blessing can be avoided.
>>
>>     my $subclass = __PACKAGE__ . "::V_$maj";
>>     if ($subclass->isa(__PACKAGE__))
>>     {
>>         bless($node, $subclass);
>>     }
>>     else
>>     {
>>         carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
>>     }
>>
> OK, thanks, will fix in next version.
>
>

Here's a version that does that and removes some recent bitrot.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: James Coleman
Дата:
Сообщение: Re: Add last commit LSN to pg_last_committed_xact()
Следующее
От: Peter Smith
Дата:
Сообщение: tab-complete COMPLETE_WITH_ATTR can become confused by table-lists.