Re: [Plperlng-devel] strange bug in plperl

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <ggray(at)inbox(dot)ru>
Cc: <pgsql-hackers(at)postgresql(dot)org>, <plperlng-devel(at)pgfoundry(dot)org>
Subject: Re: [Plperlng-devel] strange bug in plperl
Date: 2004-07-06 12:09:23
Message-ID: 2996.24.211.141.25.1089115763.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Thanks. I have 2 questions regarding this.

1. Is prodesc->fn_retistuple true if and only if this is a set returning
function? (what about setof int? what about a function returning a single
composite?)

2. I am suspicious about the use of these globals to stash data (and they
should all be marked static in any case so we don't pollute the namespace)
and already have it on my TODO list to examine them more closely. Won't they
get clobbered if our function makes an spi call which in turn calls this or
another perl function? If they will, we might need to use some sort of very
simple stack structure for this data, up to some reasonable level of
recursion (any bids?).

cheers

andrew

Sergej Sergeev said:
> Atached patch fix this bug
>
> Serg
>
>
> Andrew Dunstan wrote:
>
>>
>> Can anyone suggest why I might be seeing this effect (each notice
>> comes out once per row plus once per function call)
>>
>> thanks
>>
>> andrew
>>
>> andrew=# create function tstset() returns setof tst language plperl as
>> $$ andrew$# elog(NOTICE,"tstset called");
>> andrew$# return [{i=>1,v=>"one"},{i=>2,v=>"two"}];
>> andrew$# $$;
>> CREATE FUNCTION
>> andrew=# select * from tstset();
>> NOTICE: tstset called
>> NOTICE: tstset called
>> NOTICE: tstset called
>> i | v ---+-----
>> 1 | one
>> 2 | two
>> (2 rows)
>>
>> _______________________________________________
>> Plperlng-devel mailing list
>> Plperlng-devel(at)pgfoundry(dot)org
>> http://pgfoundry.org/mailman/listinfo/plperlng-devel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-07-06 12:22:24 Re: Quick question regarding tablespaces
Previous Message spock 2004-07-06 10:54:55 Re: Point in Time Recovery