Re: another plperl bug

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: another plperl bug
Date: 2004-11-22 20:38:26
Message-ID: 18139.1101155906@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

"Andrew Dunstan" <andrew(at)dunslane(dot)net> writes:
> I discovered a further plperl bug last night. If foo() is a SRF and
> therefore returns an arrayref, calling select foo() rather than select *
> from foo() causes a segfault because this line passes NULL as the argument:

> tupdesc = CreateTupleDescCopy(rsinfo->expectedDesc);

While looking into this I discovered another serious shortcoming: the
code was using static variables to process SETOF results, which of
course would break completely in any query involving more than one
plperl SETOF function. I also realized that the ret_hv code we were
concerned about was actually dead code, because there's a test further
up that insists that the Perl result be an array when the function is
declared to return set. So I wiped out that whole code path, for a nice
improvement in code size and legibility...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Jowett 2004-11-22 20:43:35 Re: 64Bit Solaris Compile
Previous Message Tom Lane 2004-11-22 20:34:17 Re: another plperl bug

Browse pgsql-patches by date

  From Date Subject
Next Message Michael Fuhr 2004-11-22 21:17:05 Re: another plperl bug
Previous Message Tom Lane 2004-11-22 20:34:17 Re: another plperl bug