Обсуждение: PL/Perl namespace fix

Поиск
Список
Период
Сортировка

PL/Perl namespace fix

От
Michael Fuhr
Дата:
The attached patch appears to fix the problem discussed in the
"plperl gives error after reconnect" thread in pgsql-bugs:

http://archives.postgresql.org/pgsql-bugs/2005-08/msg00133.php

Unfortunately I don't understand *why* it fixes the problem, which
means I'm not sure that it's the correct fix.  As Tom Lane and I
discovered, Perl builds with threading don't appear to have a
problem, while Perl builds without threading do.  It's not clear
to me why "mksafefunc" works in some Perl installations but
"::mksafefunc" is required in others, given otherwise identical
test conditions.  Can anybody explain?

If this is indeed the correct fix then it should probably be
backpatched to 8.0.

--
Michael Fuhr

Вложения

Re: PL/Perl namespace fix

От
Tom Lane
Дата:
Michael Fuhr <mike@fuhr.org> writes:
> The attached patch appears to fix the problem discussed in the
> "plperl gives error after reconnect" thread in pgsql-bugs:

I think this patch is a good idea just on grounds of namespace
safety, so I'll go ahead and apply it.  But like you, I have no
idea why it appears to fix the reported problem --- there don't
seem to be any namespace hazards in the test case.  I think there
is still a problem here somewhere.

            regards, tom lane

Re: PL/Perl namespace fix

От
Andrew Dunstan
Дата:

Tom Lane wrote:

>Michael Fuhr <mike@fuhr.org> writes:
>
>
>>The attached patch appears to fix the problem discussed in the
>>"plperl gives error after reconnect" thread in pgsql-bugs:
>>
>>
>
>I think this patch is a good idea just on grounds of namespace
>safety, so I'll go ahead and apply it.  But like you, I have no
>idea why it appears to fix the reported problem --- there don't
>seem to be any namespace hazards in the test case.  I think there
>is still a problem here somewhere.
>
>
>
>

Yes, very puzzling, but as you say the fix seems correct and harmless.

How far back has this bug been verified? Was it in 7.4 before we made
some large changes to plperl?

cheers

andrew

Re: PL/Perl namespace fix

От
Michael Fuhr
Дата:
On Sat, Aug 20, 2005 at 03:30:07PM -0400, Andrew Dunstan wrote:
> How far back has this bug been verified? Was it in 7.4 before we made
> some large changes to plperl?

Not sure -- the problem showed up with SPI, which wasn't in the
stock PL/Perl until 8.0.  I haven't done tests with earlier versions,
which would presumably require DBD::PgSPI.

--
Michael Fuhr