mirror of
https://github.com/postgres/postgres.git
synced 2025-06-02 00:01:40 -04:00
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
This commit is contained in:
parent
77838f7380
commit
eefdbba062
@ -1,5 +1,5 @@
|
|||||||
# Makefile for PL/Perl
|
# 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
|
subdir = src/pl/plperl
|
||||||
top_builddir = ../../..
|
top_builddir = ../../..
|
||||||
|
29
src/pl/plperl/expected/plperl_elog.out
Normal file
29
src/pl/plperl/expected/plperl_elog.out
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
-- 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.
|
* ENHANCEMENTS, OR MODIFICATIONS.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 $
|
||||||
*
|
*
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
|
23
src/pl/plperl/sql/plperl_elog.sql
Normal file
23
src/pl/plperl/sql/plperl_elog.sql
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
-- 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');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user