|
33 | 33 | * ENHANCEMENTS, OR MODIFICATIONS. |
34 | 34 | * |
35 | 35 | * IDENTIFICATION |
36 | | - * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.26 2001/11/05 17:46:39 momjian Exp $ |
| 36 | + * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.27 2002/01/24 16:53:42 tgl Exp $ |
37 | 37 | * |
38 | 38 | **********************************************************************/ |
39 | 39 |
|
@@ -488,9 +488,9 @@ plperl_func_handler(PG_FUNCTION_ARGS) |
488 | 488 | if (SPI_finish()!=SPI_OK_FINISH) |
489 | 489 | elog(ERROR,"plperl: SPI_finish() failed"); |
490 | 490 |
|
491 | | -/* XXX is this the approved way to check for an undef result? */ |
492 | | -if (perlret==&PL_sv_undef) |
| 491 | +if (!(perlret&&SvOK(perlret))) |
493 | 492 | { |
| 493 | +/* return NULL if Perl code returned undef */ |
494 | 494 | retval= (Datum)0; |
495 | 495 | fcinfo->isnull= true; |
496 | 496 | } |
|