pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: plperl tests fail with latest Perl 5.36
Date: Wed, 01 Jun 2022 16:11:53 +0100
Message-ID: <87bkvcmn9i.fsf@wibble.ilmari.org> (raw)
In-Reply-To: <564579.1654093326@sss.pgh.pa.us>
References: <564579.1654093326@sss.pgh.pa.us>

Tom Lane <tgl@sss.pgh.pa.us> writes:

> Apparently 5.36 rejiggers warning classifications in a way that breaks
> one of our test cases.  Perhaps we should switch it to some other
> warning-triggering condition.

The simplest thing is to actually use sort in void context,
i.e. removing the `my $x = ` part from the test, see the attached.

Tested on 5.36.0 and 5.8.9.

- ilmari

Attachments:

0001-Fix-plperl-test-for-change-of-warning-category-in-pe.patch (text/x-diff, 2.2K) download From e8ab5acf49c9e78a523beb01b37bcd506665f254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org> Date: Wed, 1 Jun 2022 16:07:48 +0100 Subject: [PATCH] Fix plperl test for change of warning category in perl 5.36 The warning about using in scalar context is now in the 'scalar' category, not 'void'. Actually use sort in void context to keep the warning in the same category across perl versions. --- src/pl/plperl/expected/plperl.out | 4 ++-- src/pl/plperl/sql/plperl.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pl/plperl/expected/plperl.out b/src/pl/plperl/expected/plperl.out index d8a1ff5dd8..aa02bcd5bb 100644 --- a/src/pl/plperl/expected/plperl.out +++ b/src/pl/plperl/expected/plperl.out @@ -725,8 +725,8 @@ ERROR: Can't use string ("foo") as a SCALAR ref while "strict refs" in use at l CONTEXT: PL/Perl anonymous code block -- check that we can "use warnings" (in this case to turn a warn into an error) -- yields "ERROR: Useless use of sort in scalar context." -DO $do$ use warnings FATAL => qw(void) ; my @y; my $x = sort @y; 1; $do$ LANGUAGE plperl; -ERROR: Useless use of sort in scalar context at line 1. +DO $do$ use warnings FATAL => qw(void) ; my @y; sort @y; 1; $do$ LANGUAGE plperl; +ERROR: Useless use of sort in void context at line 1. CONTEXT: PL/Perl anonymous code block -- make sure functions marked as VOID without an explicit return work CREATE OR REPLACE FUNCTION myfuncs() RETURNS void AS $$ diff --git a/src/pl/plperl/sql/plperl.sql b/src/pl/plperl/sql/plperl.sql index b0d950b230..ab222366cd 100644 --- a/src/pl/plperl/sql/plperl.sql +++ b/src/pl/plperl/sql/plperl.sql @@ -470,7 +470,7 @@ DO $do$ use strict; my $name = "foo"; my $ref = $$name; $do$ LANGUAGE plperl; -- check that we can "use warnings" (in this case to turn a warn into an error) -- yields "ERROR: Useless use of sort in scalar context." -DO $do$ use warnings FATAL => qw(void) ; my @y; my $x = sort @y; 1; $do$ LANGUAGE plperl; +DO $do$ use warnings FATAL => qw(void) ; my @y; sort @y; 1; $do$ LANGUAGE plperl; -- make sure functions marked as VOID without an explicit return work CREATE OR REPLACE FUNCTION myfuncs() RETURNS void AS $$ -- 2.30.2

view thread (5+ messages)  latest in thread

Message-ID: <87bkvcmn9i.fsf@wibble.ilmari.org>
Permalink:  ../87bkvcmn9i.fsf@wibble.ilmari.org/
Also on:    postgresql.org/message-id/87bkvcmn9i.fsf@wibble.ilmari.org

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: ilmari@ilmari.org, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: plperl tests fail with latest Perl 5.36
  In-Reply-To: <87bkvcmn9i.fsf@wibble.ilmari.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox