Commit eefdbba0 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, and adds a
small regression test for error and warning output - the new regression
input and expected output are in separate attached files.

Andrew Dunstan
parent 77838f73
# Makefile for PL/Perl
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.23 2005/07/06 22:33:39 momjian Exp $
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.24 2005/07/06 22:44:49 momjian Exp $
subdir = src/pl/plperl
top_builddir = ../../..
......
-- test warnings and errors from plperl
create or replace function perl_elog(text) returns void language plperl as $$
my $msg = shift;
elog(NOTICE,$msg);
$$;
select perl_elog('explicit elog');
NOTICE: explicit elog
perl_elog
-----------
(1 row)
create or replace function perl_warn(text) returns void language plperl as $$
my $msg = shift;
warn($msg);
$$;
select perl_warn('implicit elog via warn');
NOTICE: implicit elog via warn at (eval 7) line 4.
perl_warn
-----------
(1 row)
......@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.80 2005/07/06 22:33:39 momjian Exp $
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.81 2005/07/06 22:44:49 momjian Exp $
*
**********************************************************************/
......
-- test warnings and errors from plperl
create or replace function perl_elog(text) returns void language plperl as $$
my $msg = shift;
elog(NOTICE,$msg);
$$;
select perl_elog('explicit elog');
create or replace function perl_warn(text) returns void language plperl as $$
my $msg = shift;
warn($msg);
$$;
select perl_warn('implicit elog via warn');
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