Skip site navigation (1) Skip section navigation (2)

Re: BUG #1831: plperl gives error after reconnect.

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Sabino Mullane <greg(at)turnstep(dot)com>,pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1831: plperl gives error after reconnect.
Date: 2005-08-18 05:37:58
Message-ID: 20050818053758.GA78296@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-bugs
On Thu, Aug 18, 2005 at 12:26:28AM -0400, Tom Lane wrote:
> Michael Fuhr <mike(at)fuhr(dot)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

In response to

Responses

pgsql-bugs by date

Next:From: Bohdan LindaDate: 2005-08-18 12:47:56
Subject: BUG #1832: Can't create function in plpgsql which has more than 10 parameters
Previous:From: Bruce MomjianDate: 2005-08-18 04:41:59
Subject: Re: BUG #1768: to_char result of an interval differs between

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group