Fix plperl crash with list value return for an array result type.
Reported by Michael Fuhr, fixed by Andrew Dunstan.
This commit is contained in:
parent
807bbe6051
commit
2d481b31af
@ -33,7 +33,7 @@
|
|||||||
* ENHANCEMENTS, OR MODIFICATIONS.
|
* ENHANCEMENTS, OR MODIFICATIONS.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.85 2005/07/12 01:16:21 tgl Exp $
|
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.86 2005/07/12 20:35:42 tgl Exp $
|
||||||
*
|
*
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
@ -1020,8 +1020,8 @@ plperl_func_handler(PG_FUNCTION_ARGS)
|
|||||||
/* Return a perl string converted to a Datum */
|
/* Return a perl string converted to a Datum */
|
||||||
char *val;
|
char *val;
|
||||||
|
|
||||||
|
if (prodesc->fn_retisarray && SvROK(perlret) &&
|
||||||
if (prodesc->fn_retisarray && SvTYPE(SvRV(perlret)) == SVt_PVAV)
|
SvTYPE(SvRV(perlret)) == SVt_PVAV)
|
||||||
{
|
{
|
||||||
array_ret = plperl_convert_to_pg_array(perlret);
|
array_ret = plperl_convert_to_pg_array(perlret);
|
||||||
SvREFCNT_dec(perlret);
|
SvREFCNT_dec(perlret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user