projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f1edb9d
)
Fix incorrect test for whether Perl code is returning undef. This
author
Tom Lane
<
[email protected]
>
Thu, 24 Jan 2002 16:53:42 +0000
(16:53 +0000)
committer
Tom Lane
<
[email protected]
>
Thu, 24 Jan 2002 16:53:42 +0000
(16:53 +0000)
allows plperl routines to return NULL as intended.
src/pl/plperl/plperl.c
patch
|
blob
|
blame
|
history
diff --git
a/src/pl/plperl/plperl.c
b/src/pl/plperl/plperl.c
index 8e446b443149a384cf083593988a85d91567f5ec..4bb83d245560d72d2676d9fcc3e2aca107582f3b 100644
(file)
--- a/
src/pl/plperl/plperl.c
+++ b/
src/pl/plperl/plperl.c
@@
-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;
}