diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-07-12 20:35:42 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-07-12 20:35:42 +0000 |
commit | 2d481b31af5ec92a8b940cf8198c5197289aa61e (patch) | |
tree | 1b9b724b6760a3537a4d58b3cf01e66d5ea8a0be /src/pl/plperl/plperl.c | |
parent | 807bbe6051de32dab969d0ed33807747af5a2b45 (diff) | |
download | postgresql-2d481b31af5ec92a8b940cf8198c5197289aa61e.tar.gz postgresql-2d481b31af5ec92a8b940cf8198c5197289aa61e.zip |
Fix plperl crash with list value return for an array result type.
Reported by Michael Fuhr, fixed by Andrew Dunstan.
Diffstat (limited to 'src/pl/plperl/plperl.c')
-rw-r--r-- | src/pl/plperl/plperl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c index 664688a32b9..3e97fb87557 100644 --- a/src/pl/plperl/plperl.c +++ b/src/pl/plperl/plperl.c @@ -33,7 +33,7 @@ * ENHANCEMENTS, OR MODIFICATIONS. * * 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 */ char *val; - - if (prodesc->fn_retisarray && SvTYPE(SvRV(perlret)) == SVt_PVAV) + if (prodesc->fn_retisarray && SvROK(perlret) && + SvTYPE(SvRV(perlret)) == SVt_PVAV) { array_ret = plperl_convert_to_pg_array(perlret); SvREFCNT_dec(perlret); |