Re: PL/Perl list value return causes segfault

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: PL/Perl list value return causes segfault
Дата
Msg-id 42D44731.90306@dunslane.net
обсуждение исходный текст
Ответ на Re: PL/Perl list value return causes segfault  (David Fetter <david@fetter.org>)
Ответы Re: PL/Perl list value return causes segfault  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers

David Fetter wrote:

>On Tue, Jul 12, 2005 at 03:45:55PM -0400, Andrew Dunstan wrote:
>  
>
>>
>>In perl, if there is any ambiguity it is the called function that is
>>responsible for checking, not the caller. See "perldoc -f
>>wantarray".  PLPerl explicitly passed G_SCALAR as a flag on all
>>calls to plperl routines. So returning a list is a case of pilot
>>error.
>>    
>>
>
>Is this a kind of pilot error that documents could help avert in some
>useful way?
>
>
>  
>

Sure. "A plperl function must always return a scalar value.More complex 
structures (arrays, records, and sets) can be returned in the 
appropriate context by returning a reference. A list should never be 
returned."  Salt to taste and insert where appropriate.

cheers

andrew


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Denis Lussier"
Дата:
Сообщение: Re: dbt2 & opteron performance
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: PL/Perl list value return causes segfault