summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-01-24 16:53:42 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-01-24 16:53:42 +0000
commita45641d8a4993ce7d3b5388fb63e34acaffde87b (patch)
tree0143d244eeba371a979c7511874fe52dc79d270b
parent386f1809a7db5c4d610ea8ba7cd702e699f1b4a9 (diff)
downloadpostgresql-a45641d8a4993ce7d3b5388fb63e34acaffde87b.tar.gz
Fix incorrect test for whether Perl code is returning undef. This
allows plperl routines to return NULL as intended.
-rw-r--r--src/pl/plperl/plperl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 99af921307..a37f59781f 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.26 2001/11/05 17:46:39 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.27 2002/01/24 16:53:42 tgl Exp $
*
**********************************************************************/
@@ -488,9 +488,9 @@ plperl_func_handler(PG_FUNCTION_ARGS)
if (SPI_finish() != SPI_OK_FINISH)
elog(ERROR, "plperl: SPI_finish() failed");
- /* XXX is this the approved way to check for an undef result? */
- if (perlret == &PL_sv_undef)
+ if (!(perlret && SvOK(perlret)))
{
+ /* return NULL if Perl code returned undef */
retval = (Datum) 0;
fcinfo->isnull = true;
}