PL/Perl namespace fix

Started by Michael Fuhrabout 21 years ago4 messagespatches
Jump to latest
#1Michael Fuhr
mike@fuhr.org

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

Attachments:

plperl-namespace.patchtext/plain; charset=us-asciiDownload+2-2
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Fuhr (#1)
Re: PL/Perl namespace fix

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

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#2)
Re: PL/Perl namespace fix

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

#4Michael Fuhr
mike@fuhr.org
In reply to: Andrew Dunstan (#3)
Re: PL/Perl namespace fix

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