Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita45641d

Browse files
committed
Fix incorrect test for whether Perl code is returning undef. This
allows plperl routines to return NULL as intended.
1 parent386f180 commita45641d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/pl/plperl/plperl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* ENHANCEMENTS, OR MODIFICATIONS.
3434
*
3535
* 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 $
3737
*
3838
**********************************************************************/
3939

@@ -488,9 +488,9 @@ plperl_func_handler(PG_FUNCTION_ARGS)
488488
if (SPI_finish()!=SPI_OK_FINISH)
489489
elog(ERROR,"plperl: SPI_finish() failed");
490490

491-
/* XXX is this the approved way to check for an undef result? */
492-
if (perlret==&PL_sv_undef)
491+
if (!(perlret&&SvOK(perlret)))
493492
{
493+
/* return NULL if Perl code returned undef */
494494
retval= (Datum)0;
495495
fcinfo->isnull= true;
496496
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp