On Sat, Aug 20, 2005 at 01:52:42PM -0600, Michael Fuhr wrote:
> The attached patch allows the PL/Perl regression tests to pass when
> use_strict is enabled. I've also attached a variant of plperl_elog.out
> to account for an elog() message that shows a different line number
> when run under use_strict.
Here's an updated version of the PL/Perl regression test patch that
works with Andrew Dunstan's strict mode patch, both when use_strict
is enabled and when it's disabled. The variant of plperl_elog.out
is no longer needed.
--
Michael Fuhr
Index: src/pl/plperl/expected/plperl.out
===================================================================
RCS file: /projects/cvsroot/pgsql/src/pl/plperl/expected/plperl.out,v
retrieving revision 1.4
diff -c -r1.4 plperl.out
*** src/pl/plperl/expected/plperl.out 12 Jul 2005 01:16:22 -0000 1.4
--- src/pl/plperl/expected/plperl.out 24 Aug 2005 02:17:08 -0000
***************
*** 336,342 ****
-- Test return_next
--
CREATE OR REPLACE FUNCTION perl_srf_rn() RETURNS SETOF RECORD AS $$
! $i = 0;
for ("World", "PostgreSQL", "PL/Perl") {
return_next({f1=>++$i, f2=>'Hello', f3=>$_});
}
--- 336,342 ----
-- Test return_next
--
CREATE OR REPLACE FUNCTION perl_srf_rn() RETURNS SETOF RECORD AS $$
! my $i = 0;
for ("World", "PostgreSQL", "PL/Perl") {
return_next({f1=>++$i, f2=>'Hello', f3=>$_});
}
***************
*** 354,361 ****
-- Test spi_query/spi_fetchrow
--
CREATE OR REPLACE FUNCTION perl_spi_func() RETURNS SETOF INTEGER AS $$
! $x = spi_query("select 1 as a union select 2 as a");
! while (defined ($y = spi_fetchrow($x))) {
return_next($y->{a});
}
return;
--- 354,361 ----
-- Test spi_query/spi_fetchrow
--
CREATE OR REPLACE FUNCTION perl_spi_func() RETURNS SETOF INTEGER AS $$
! my $x = spi_query("select 1 as a union select 2 as a");
! while (defined (my $y = spi_fetchrow($x))) {
return_next($y->{a});
}
return;
Index: src/pl/plperl/expected/plperl_elog.out
===================================================================
RCS file: /projects/cvsroot/pgsql/src/pl/plperl/expected/plperl_elog.out,v
retrieving revision 1.2
diff -c -r1.2 plperl_elog.out
*** src/pl/plperl/expected/plperl_elog.out 7 Jul 2005 04:41:01 -0000
1.2
--- src/pl/plperl/expected/plperl_elog.out 24 Aug 2005 02:17:08 -0000
***************
*** 19,25 ****
$$;
select perl_warn('implicit elog via warn');
! NOTICE: implicit elog via warn at (eval 7) line 4.
perl_warn
-----------
--- 19,25 ----
$$;
select perl_warn('implicit elog via warn');
! NOTICE: implicit elog via warn at (eval 8) line 4.
perl_warn
-----------
Index: src/pl/plperl/sql/plperl.sql
===================================================================
RCS file: /projects/cvsroot/pgsql/src/pl/plperl/sql/plperl.sql,v
retrieving revision 1.4
diff -c -r1.4 plperl.sql
*** src/pl/plperl/sql/plperl.sql 12 Jul 2005 01:16:22 -0000 1.4
--- src/pl/plperl/sql/plperl.sql 24 Aug 2005 02:17:08 -0000
***************
*** 240,246 ****
--
CREATE OR REPLACE FUNCTION perl_srf_rn() RETURNS SETOF RECORD AS $$
! $i = 0;
for ("World", "PostgreSQL", "PL/Perl") {
return_next({f1=>++$i, f2=>'Hello', f3=>$_});
}
--- 240,246 ----
--
CREATE OR REPLACE FUNCTION perl_srf_rn() RETURNS SETOF RECORD AS $$
! my $i = 0;
for ("World", "PostgreSQL", "PL/Perl") {
return_next({f1=>++$i, f2=>'Hello', f3=>$_});
}
***************
*** 253,260 ****
--
CREATE OR REPLACE FUNCTION perl_spi_func() RETURNS SETOF INTEGER AS $$
! $x = spi_query("select 1 as a union select 2 as a");
! while (defined ($y = spi_fetchrow($x))) {
return_next($y->{a});
}
return;
--- 253,260 ----
--
CREATE OR REPLACE FUNCTION perl_spi_func() RETURNS SETOF INTEGER AS $$
! my $x = spi_query("select 1 as a union select 2 as a");
! while (defined (my $y = spi_fetchrow($x))) {
return_next($y->{a});
}
return;
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster