Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7A45BB5DC09 for ; Fri, 27 May 2011 17:53:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 71070-04 for ; Fri, 27 May 2011 20:53:28 +0000 (UTC) X-Greylist: delayed 00:09:27.008712 by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 59B54B5DBF6 for ; Fri, 27 May 2011 17:53:28 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id F2396348045; Fri, 27 May 2011 13:44:00 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O9tpzXaYPy2j; Fri, 27 May 2011 13:43:58 -0700 (PDT) Received: from [172.16.132.54] (unknown [88.135.126.187]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 73462348044; Fri, 27 May 2011 13:43:57 -0700 (PDT) Subject: Re: 9.1 plperlu bug with null rows in trigger hash Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Alexey Klyukin In-Reply-To: Date: Fri, 27 May 2011 23:43:54 +0300 Cc: pgsql-bugs@postgresql.org, Greg Sabino Mullane Content-Transfer-Encoding: quoted-printable Message-Id: References: <20110523205931.GM4253@core.home> <20110524020846.GN4253@core.home> To: Alex Hunsaker X-Mailer: Apple Mail (2.1084) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201105/204 X-Sequence-Number: 30343 On May 27, 2011, at 7:14 PM, Alex Hunsaker wrote: > On Mon, May 23, 2011 at 20:08, Greg Sabino Mullane = wrote: >> On Mon, May 23, 2011 at 05:04:40PM -0600, Alex Hunsaker wrote: >> ... >>> Greg, can you confirm the attached fixes it for you? >>=20 >> Yes, seems to have done the job, thank you. >=20 > Thanks for testing! >=20 > [ Does a little dance to try and attract a -commiter ] >=20 > This was broken as part of: > commit 87bb2ade2ce646083f39d5ab3e3307490211ad04 > Author: Alvaro Herrera > Date: Thu Feb 17 22:11:50 2011 -0300 >=20 > Convert Postgres arrays to Perl arrays on PL/perl input arguments >=20 > More generally, arrays are turned in Perl array references, and row = and > composite types are turned into Perl hash references. This is done > recursively, in a way that's natural to every Perl programmer. >=20 > To avoid a backwards compatibility hit, the string representation = of > each structure is also available if the function requests it. >=20 > Authors: Alexey Klyukin and Alex Hunsaker. > Some code cleanups by me. >=20 > Which also means it only breaks HEAD/9.1 (I did test and review 9.0 = and down.) >=20 > Per = http://search.cpan.org/~jesse/perl-5.14.0/pod/perlguts.pod#AVs,_HVs_and_un= defined_values, > we do not want to use &PL_sv_undef for undef values in hashes and > arrays. I (inadvertently) broke this in the above commit. As perldoc > mentions &PL_sv_undef seems like the intuitive thing to use. But its > wrong in certain cases. Yeah, per the link above the problem is evident and after a little = testing I think your patch fixed the problem. Thank you for tracking down this! >=20 > We have 6 other uses of &PL_sv_undef, 2 &PL_sv_no and 1 &PL_sv_yes. > These are all ok as none of them use the HV/AV store interface. >=20 > I elected _not_ to add any regression tests. (If we forget about this > in the future, it will likely be in other code paths). Instead I added > comments to the places that used &PL_sv_undef noting that we > explicitly avoid it on purpose. +1. -- Alexey Klyukin The PostgreSQL Company - Command Prompt, Inc.