From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Greg Sabino Mullane <greg(at)turnstep(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Anyone tried PG with Perl 5.10? |
Date: | 2008-01-22 02:33:26 |
Message-ID: | 479555F6.3070001@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Andrew Dunstan wrote:
>
>
> Andrew Dunstan wrote:
>>
>>
>> Greg Sabino Mullane wrote:
>>>> I read that Perl 5.10 is about to hit Fedora rawhide. Anyone know if
>>>> it will work with plperl and/or DBD::Pg? If there are fixes needed
>>>> in plperl, it'd sure be nice if they were in 8.3 ...
>>>>
>>>
>>> I've tested 5.10 against both and they seem to work fine. My plperl
>>> tests
>>> are not necessarily thorough, but it compiled smoothly and ran a
>>> bunch of
>>> plperlu code without a problem. DBD::Pg worked fine, all its tests
>>> passed.
>>>
>>>
>>>
>>
>> For plperl, we need to test at least:
>>
>> * standard plperl regression tests
>> * the UTF8 problem we recently fixed
>>
>>
>
> First news is not good. On my test we have failed one of the
> regression tests - the "use strict" processing seems to be backwards.
> I will try to get to the bottom of it.
>
>
This problem has been identified by Simon Cozens as a bug in perl 5.10
(in that it is an undocumented change in Safe.pm). he will file a perl
bug report on it. The small patch below (also his suggestion, more or
less) fixes the problem. We turn on access to the caller opcode just
while we load the strict module. This should be perfectly safe. I intend
to apply it shortly and to backpatch it, unless there's an objection.
The UTF8 code appears to be still working, which was the other concern I
had.
cheers
andrew
Index: plperl.c
===================================================================
RCS file: /cvsroot/pgsql/src/pl/plperl/plperl.c,v
retrieving revision 1.134
diff -c -u -r1.134 plperl.c
cvs diff: conflicting specifications of output style
--- plperl.c 1 Dec 2007 17:58:42 -0000 1.134
+++ plperl.c 22 Jan 2008 02:31:08 -0000
@@ -272,8 +272,8 @@
"sub ::mksafefunc {" \
" my $ret = $PLContainer->reval(qq[sub { $_[0] $_[1] }]); " \
" $@ =~ s/\\(eval \\d+\\) //g if $@; return $ret; }" \
- "$PLContainer->permit('require'); $PLContainer->reval('use
strict;');" \
- "$PLContainer->deny('require');" \
+ "$PLContainer->permit(qw[require caller]);
$PLContainer->reval('use strict;');" \
+ "$PLContainer->deny(qw[require caller]); " \
"sub ::mk_strict_safefunc {" \
" my $ret = $PLContainer->reval(qq[sub { BEGIN {
strict->import(); } $_[0] $_[1] }]); " \
" $@ =~ s/\\(eval \\d+\\) //g if $@; return $ret; }"
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2008-01-22 02:40:08 | Re: Makefile support for Mac OS X Fat Binaries? |
Previous Message | Larry Rosenman | 2008-01-22 01:23:39 | Re: Makefile support for Mac OS X Fat Binaries? |