Skip to content
Snippets Groups Projects
Commit a45641d8 authored by Tom Lane's avatar Tom Lane
Browse files

Fix incorrect test for whether Perl code is returning undef. This

allows plperl routines to return NULL as intended.
parent 386f1809
Branches
Tags
No related merge requests found
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS. * ENHANCEMENTS, OR MODIFICATIONS.
* *
* IDENTIFICATION * 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) ...@@ -488,9 +488,9 @@ plperl_func_handler(PG_FUNCTION_ARGS)
if (SPI_finish() != SPI_OK_FINISH) if (SPI_finish() != SPI_OK_FINISH)
elog(ERROR, "plperl: SPI_finish() failed"); elog(ERROR, "plperl: SPI_finish() failed");
/* XXX is this the approved way to check for an undef result? */ if (!(perlret && SvOK(perlret)))
if (perlret == &PL_sv_undef)
{ {
/* return NULL if Perl code returned undef */
retval = (Datum) 0; retval = (Datum) 0;
fcinfo->isnull = true; fcinfo->isnull = true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment