From: Andrew Dunstan on


Tim Bunce wrote:
> I was investigating a bug in an 8.4.1 production system and distilled a
> test case down to this:
>
> CREATE OR REPLACE FUNCTION bar() RETURNS integer AS $$
> #die 'BANG!'; # causes server process to exit(2)
> # alternative - causes server process to exit(255)
> spi_exec_query("invalid sql statement");
> $$ language plperl; -- plperl or plperlu
>
> CREATE OR REPLACE FUNCTION foo() RETURNS integer AS $$
> spi_exec_query("SELECT * FROM bar()");
> return 1;
> $$ LANGUAGE plperlu; -- must be opposite to language of bar
>
> SELECT * FROM bar(); -- throws exception normally
> SELECT * FROM foo(); -- causes the server to exit abnormaly
>
> before then rereading the 8.4.2 release notes and seeing that the bug
> was already fixed. D'oh!
>
> I see the test suite doesn't have any plperlu tests at all.
> Is there any reason for that?
>
>
>

Just that we haven't bothered. But we can't run tests for both in the
same session because that doesn't work on all platforms. I actually
played a bit with it the other day. Setting up some plperlu tests would
be very simple.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: decibel on
On Jan 6, 2010, at 5:46 PM, Andrew Dunstan wrote:
> Tim Bunce wrote:
>> I was investigating a bug in an 8.4.1 production system and distilled a
>> test case down to this:
>>
>> CREATE OR REPLACE FUNCTION bar() RETURNS integer AS $$
>> #die 'BANG!'; # causes server process to exit(2)
>> # alternative - causes server process to exit(255)
>> spi_exec_query("invalid sql statement");
>> $$ language plperl; -- plperl or plperlu
>> CREATE OR REPLACE FUNCTION foo() RETURNS integer AS $$
>> spi_exec_query("SELECT * FROM bar()");
>> return 1;
>> $$ LANGUAGE plperlu; -- must be opposite to language of bar
>> SELECT * FROM bar(); -- throws exception normally
>> SELECT * FROM foo(); -- causes the server to exit abnormaly
>>
>> before then rereading the 8.4.2 release notes and seeing that the bug
>> was already fixed. D'oh!
>>
>> I see the test suite doesn't have any plperlu tests at all.
>> Is there any reason for that?
>>
>>
>>
>
> Just that we haven't bothered. But we can't run tests for both in the same session because that doesn't work on all platforms. I actually played a bit with it the other day. Setting up some plperlu tests would be very simple.

We've actually run into similar issues. Alvaro came up with a patch that fixes our specific issue, but I think he said there were some other cases that needed to be fixed as well. Anyone looking to fix this should ping Alvaro first.
--
Jim C. Nasby, Database Architect jim(a)nasby.net
512.569.9461 (cell) http://jim.nasby.net



--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Alvaro Herrera on
decibel wrote:

> We've actually run into similar issues. Alvaro came up with a patch
> that fixes our specific issue, but I think he said there were some
> other cases that needed to be fixed as well. Anyone looking to fix
> this should ping Alvaro first.

No, what I fixed was the contrib/xml2 crasher that I still haven't
submitted here (sorry). The plperl fix came from Alexey Klyukin, and
AFAIK the fix is in 8.4.2.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Andrew Dunstan on


Alvaro Herrera wrote:
> decibel wrote:
>
>
>> We've actually run into similar issues. Alvaro came up with a patch
>> that fixes our specific issue, but I think he said there were some
>> other cases that needed to be fixed as well. Anyone looking to fix
>> this should ping Alvaro first.
>>
>
> No, what I fixed was the contrib/xml2 crasher that I still haven't
> submitted here (sorry). The plperl fix came from Alexey Klyukin, and
> AFAIK the fix is in 8.4.2.
>

Yes.

[thinks]

Could we have a regression test for it with an alternative result file
for the case where plperl and plperlu are not allowed to run together?

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Tim Bunce on
On Wed, Jan 06, 2010 at 07:07:12PM -0500, Andrew Dunstan wrote:
>
> Alvaro Herrera wrote:
> >decibel wrote:
> >
> >>We've actually run into similar issues. Alvaro came up with a patch
> >>that fixes our specific issue, but I think he said there were some
> >>other cases that needed to be fixed as well. Anyone looking to fix
> >>this should ping Alvaro first.
> >
> >No, what I fixed was the contrib/xml2 crasher that I still haven't
> >submitted here (sorry). The plperl fix came from Alexey Klyukin, and
> >AFAIK the fix is in 8.4.2.
>
> Yes.
>
> [thinks]
>
> Could we have a regression test for it with an alternative result
> file for the case where plperl and plperlu are not allowed to run
> together?

Or perhaps put the tests that require multiplicity into a plperl_multi.sql
file and add logic to the GNUmakefile to add that file to REGRESS
if "perl -V:usemultiplicity" returns "usemultiplicity='define';"

Tim.

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers