mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +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:
@ -33,7 +33,7 @@
|
|||||||
* ENHANCEMENTS, OR MODIFICATIONS.
|
* ENHANCEMENTS, OR MODIFICATIONS.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.94.2.12 2009/06/05 20:32:41 adunstan Exp $
|
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.94.2.13 2009/09/28 17:30:04 adunstan Exp $
|
||||||
*
|
*
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
@ -1805,7 +1805,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 = FunctionCall3(&prodesc->result_in_func,
|
ret = FunctionCall3(&prodesc->result_in_func,
|
||||||
PointerGetDatum(val),
|
PointerGetDatum(val),
|
||||||
|
Reference in New Issue
Block a user