Re: pl/python do not delete function arguments - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: pl/python do not delete function arguments
Date
Msg-id 1297744740.18922.3.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: pl/python do not delete function arguments  (Jan Urbański <wulczer@wulczer.org>)
Responses Re: pl/python do not delete function arguments  (Jan Urbański <wulczer@wulczer.org>)
List pgsql-hackers
On mån, 2011-02-14 at 22:22 +0100, Jan Urbański wrote:
> The problem is that every *second* call to the function fails,
> regardless of the number. The first execution succeeds, but then
> PLy_delete_args deletes the argument from the globals, and when the
> next execution tries to fetch "n" from it, it raises a KeyError.

This isn't quite right either, because it obviously depends on the
recursion somehow.  So in

SELECT recursion_test(5);
SELECT recursion_test(4);

it is the first recursive invocation of the (4) call that fails.  If you
just do

SELECT recursion_test(1);
SELECT recursion_test(1);
SELECT recursion_test(1);

nothing fails.  (We'd have noticed that sooner, obviously. ;-) )

But in

SELECT recursion_test(1);
SELECT recursion_test(4);
SELECT recursion_test(1);

it's the last (1) call, which is not recursive, that fails.

Your patch obviously fixes all that, but I'm wondering if we have
another problem with the procedure caching somehow.  And I'm also
wondering what to put into the commit message. :-/




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: why two dashes in extension load files
Next
From: Peter Eisentraut
Date:
Subject: Re: CommitFest 2011-01 as of 2011-02-04