mirror of
https://github.com/postgres/postgres.git
synced 2025-06-08 22:02:03 +03:00
Un-break plperl for non-set case.
This commit is contained in:
parent
7d781c62b1
commit
65790b9e01
@ -33,7 +33,7 @@
|
|||||||
* ENHANCEMENTS, OR MODIFICATIONS.
|
* ENHANCEMENTS, OR MODIFICATIONS.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.88 2005/08/12 21:09:34 momjian Exp $
|
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.89 2005/08/12 21:26:32 tgl Exp $
|
||||||
*
|
*
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
@ -923,10 +923,12 @@ plperl_func_handler(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
rsi = (ReturnSetInfo *)fcinfo->resultinfo;
|
rsi = (ReturnSetInfo *)fcinfo->resultinfo;
|
||||||
|
|
||||||
|
if (prodesc->fn_retisset)
|
||||||
|
{
|
||||||
|
/* Check context before allowing the call to go through */
|
||||||
if (!rsi || !IsA(rsi, ReturnSetInfo) ||
|
if (!rsi || !IsA(rsi, ReturnSetInfo) ||
|
||||||
(rsi->allowedModes & SFRM_Materialize) == 0 ||
|
(rsi->allowedModes & SFRM_Materialize) == 0 ||
|
||||||
rsi->expectedDesc == NULL)
|
rsi->expectedDesc == NULL)
|
||||||
{
|
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("set-valued function called in context that "
|
errmsg("set-valued function called in context that "
|
||||||
@ -946,10 +948,12 @@ plperl_func_handler(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
if (prodesc->fn_retisset)
|
if (prodesc->fn_retisset)
|
||||||
{
|
{
|
||||||
/* If the Perl function returned an arrayref, we pretend that it
|
/*
|
||||||
|
* If the Perl function returned an arrayref, we pretend that it
|
||||||
* called return_next() for each element of the array, to handle
|
* called return_next() for each element of the array, to handle
|
||||||
* old SRFs that didn't know about return_next(). Any other sort
|
* old SRFs that didn't know about return_next(). Any other sort
|
||||||
* of return value is an error. */
|
* of return value is an error.
|
||||||
|
*/
|
||||||
if (SvTYPE(perlret) == SVt_RV &&
|
if (SvTYPE(perlret) == SVt_RV &&
|
||||||
SvTYPE(SvRV(perlret)) == SVt_PVAV)
|
SvTYPE(SvRV(perlret)) == SVt_PVAV)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user