Re: BUG #1831: plperl gives error after reconnect. - Mailing list pgsql-bugs

From Michael Fuhr
Subject Re: BUG #1831: plperl gives error after reconnect.
Date
Msg-id 20050818053758.GA78296@winnie.fuhr.org
Whole thread Raw
In response to Re: BUG #1831: plperl gives error after reconnect.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #1831: plperl gives error after reconnect.
List pgsql-bugs
On Thu, Aug 18, 2005 at 12:26:28AM -0400, Tom Lane wrote:
> Michael Fuhr <mike@fuhr.org> writes:
> > Could this be another "depends on the junk on your stack" bug?
>
> Looks that way --- but I've still had no success in reproducing it,
> either on x86/Linux or PPC/Darwin.  Anyone have some variant test
> cases?

I see different results depending on whether the calling function
is plperl or plperlu.  Here again are the functions -- I'll change
only the language:

CREATE OR REPLACE FUNCTION foo() RETURNS text AS $$
return "foo";
$$ LANGUAGE plperl;

CREATE OR REPLACE FUNCTION bar() RETURNS text AS $$
my $rv = spi_exec_query("SELECT foo()");
return $rv->{rows}[0]->{foo};
$$ LANGUAGE plperl;

SELECT bar();

With HEAD on Solaris 9/sparc I don't have to reconnect before the
SELECT to get the error (I tested both ways, with and without a
reconnect, and it made no difference).  Here's what I get with
various language combinations:

foo plperl,  bar plperl  - Undefined subroutine &main::mksafefunc
foo plperl,  bar plperlu - ok
foo plperlu, bar plperl  - Undefined subroutine &main::mkunsafefunc
foo plperlu, bar plperlu - ok

I get the same results on FreeBSD 4.11-STABLE/x86 but I have to
reconnect before the SELECT to get the error.  On both systems,
if I execute SELECT foo() before SELECT bar() then I don't get
the error.

--
Michael Fuhr

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #1768: to_char result of an interval differs between
Next
From: "Bohdan Linda"
Date:
Subject: BUG #1832: Can't create function in plpgsql which has more than 10 parameters