mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
Convert a perl array to a postgres array when returned by Set Returning Functions as well as non SRFs. Backpatch to 8.1 where these facilities were introduced. with a little help from Abhijit Menon-Sen.
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* plperl.c - perl as a procedural language for PostgreSQL
|
* plperl.c - perl as a procedural language for PostgreSQL
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.123.2.6 2009/06/05 20:32:27 adunstan Exp $
|
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.123.2.7 2009/09/28 17:30:24 adunstan Exp $
|
||||||
*
|
*
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
@ -1960,7 +1960,15 @@ plperl_return_next(SV *sv)
|
|||||||
|
|
||||||
if (SvOK(sv))
|
if (SvOK(sv))
|
||||||
{
|
{
|
||||||
char *val = SvPV(sv, PL_na);
|
char *val;
|
||||||
|
|
||||||
|
if (prodesc->fn_retisarray && SvROK(sv) &&
|
||||||
|
SvTYPE(SvRV(sv)) == SVt_PVAV)
|
||||||
|
{
|
||||||
|
sv = plperl_convert_to_pg_array(sv);
|
||||||
|
}
|
||||||
|
|
||||||
|
val = SvPV(sv, PL_na);
|
||||||
|
|
||||||
ret = InputFunctionCall(&prodesc->result_in_func, val,
|
ret = InputFunctionCall(&prodesc->result_in_func, val,
|
||||||
prodesc->result_typioparam, -1);
|
prodesc->result_typioparam, -1);
|
||||||
|
Reference in New Issue
Block a user