Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nwQ0z-00024C-24 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jun 2022 15:12:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nwQ0x-0003ei-VP for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jun 2022 15:12:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nwQ0w-0003du-81 for pgsql-hackers@lists.postgresql.org; Wed, 01 Jun 2022 15:12:03 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nwQ0r-00031D-0G for pgsql-hackers@lists.postgresql.org; Wed, 01 Jun 2022 15:12:01 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B68C35C02BC; Wed, 1 Jun 2022 11:11:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 01 Jun 2022 11:11:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1654096315; x=1654182715; bh=zkrdWd/NYU vwq4yn9PG4AeSLP3hRFM6ZROE3ZngvVuI=; b=G+88UJoboaeXHgDjna5rG676p7 6MIJwcv1+MNQGObkOa+BP+i8Wr2h9fvhiSyYNF0SoGgmOU2HpUqdBNPyfkhBDRkI RsVn6PffJhnG+e8dJe/7/jVHJXDN3L5TKzyi9n0U9VtECjiIisJ5Bz9BZ1o/rmsm sZg4iXe0edpmvnquBLVsGiyDXcI1OalzPTp7XqRABCGOM6/JouwAx6xkcq9V/RSe uFabzQJ45U9YzMKNvY75X85IC/H7uClPwpxoFTxMhXuMmKYddykrV4L0piEMx+gh dy8yqJE0cmPwle+XTUyOrL/cl7sKIDTF8/LMmAPNZKp8zy63dI+Bk+MAvWow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1654096315; x=1654182715; bh=zkrdWd/NYUvwq4yn9PG4AeSLP3hR FM6ZROE3ZngvVuI=; b=K1rH1nfxX4wkewrWkjKDMdAdYh+oUj749ummWlAkoDDQ x+mnHjn1nN3wEtJxluXXrwPkukpRhfL64/ShZDP1VYjGA2oHfgwobhwVspAELy2X Zuc5tMxFOWyeF9ZkiKgYZQhkQWBlTI39wLWns8CCsUYwktL7M+0Jyr4S5tbyqbPY XSqY32tL+QA4doVUSrNa2nMWc36Ny0V8OL+m1NaqiIPcU9obUNhfXLlYF13dLS6F 51uy8B61EtcTwxwnB6/79qfYLT+Ka37RxEaLamR33Gngtelnsj9GDSEpCNglZksh aoagI1j4wils18q0SVg1PhRnZ1dWED7U8j0O332JtA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrledtgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufhffjgfkfgggtgesmhdtre ertderjeenucfhrhhomhepffgrghhfihhnnhgpkfhlmhgrrhhipgforghnnhhsnohkvghr uceoihhlmhgrrhhisehilhhmrghrihdrohhrgheqnecuggftrfgrthhtvghrnhepuefgfe duuedtjeeuheetjeeukefhjedtveehjeelhfdutedvieeltddvuedvuddvnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhlmhgrrhhisehilh hmrghrihdrohhrgh X-ME-Proxy: Feedback-ID: i1ff147bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Jun 2022 11:11:55 -0400 (EDT) From: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org Subject: Re: plperl tests fail with latest Perl 5.36 References: <564579.1654093326@sss.pgh.pa.us> Date: Wed, 01 Jun 2022 16:11:53 +0100 In-Reply-To: <564579.1654093326@sss.pgh.pa.us> (Tom Lane's message of "Wed, 01 Jun 2022 10:22:06 -0400") Message-ID: <87bkvcmn9i.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain Tom Lane 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-plperl-test-for-change-of-warning-category-in-pe.patch From e8ab5acf49c9e78a523beb01b37bcd506665f254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= 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 --=-=-=--