Commit 77838f73 authored by Bruce Momjian's avatar Bruce Momjian

Currently, nonfatal warnings are not trapped (as they should be) by

plperl - the attached small patch remedies that omission.

Andrew Dunstan
parent 970bb03c
# Makefile for PL/Perl
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.22 2005/05/24 17:07:41 tgl Exp $
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.23 2005/07/06 22:33:39 momjian Exp $
subdir = src/pl/plperl
top_builddir = ../../..
......@@ -37,7 +37,7 @@ OBJS = plperl.o spi_internal.o SPI.o
SHLIB_LINK = $(perl_embed_ldflags) $(BE_DLLLIBS)
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl
REGRESS = plperl plperl_trigger plperl_shared
REGRESS = plperl plperl_trigger plperl_shared plperl_elog
include $(top_srcdir)/src/Makefile.shlib
......
......@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.79 2005/07/03 21:56:16 tgl Exp $
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.80 2005/07/06 22:33:39 momjian Exp $
*
**********************************************************************/
......@@ -190,6 +190,8 @@ plperl_init_interp(void)
"", "-e",
/* all one string follows (no commas please) */
"SPI::bootstrap(); use vars qw(%_SHARED);"
"sub ::plperl_warn { my $msg = shift; &elog(&NOTICE, $msg); } "
"$SIG{__WARN__} = \\&::plperl_warn; "
"sub ::mkunsafefunc {return eval(qq[ sub { $_[0] $_[1] } ]); }"
};
......@@ -197,6 +199,8 @@ plperl_init_interp(void)
"", "-e",
/* all one string follows (no commas please) */
"SPI::bootstrap(); use vars qw(%_SHARED);"
"sub ::plperl_warn { my $msg = shift; &elog(&NOTICE, $msg); } "
"$SIG{__WARN__} = \\&::plperl_warn; "
"sub ::mkunsafefunc {return eval("
"qq[ sub { use strict; $_[0] $_[1] } ]); }"
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment