Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id A7D4E14D375 for ; Sun, 18 Mar 2012 01:12:12 -0300 (ADT) Received: from mail.mystoragebox.com ([64.27.7.19]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S97TV-0006SP-1P for pgsql-bugs@postgresql.org; Sun, 18 Mar 2012 04:12:11 +0000 Received: from cpe-67-240-79-210.nycap.res.rr.com ([67.240.79.210] helo=[192.168.35.110]) by mail.mystoragebox.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1S978y-0007Kw-7W; Sat, 17 Mar 2012 23:50:56 -0400 Message-ID: <4F656084.2050207@kobaz.net> Date: Sun, 18 Mar 2012 00:11:48 -0400 From: "Mark M." User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Alex Hunsaker CC: Bruce Momjian , pgsql-bugs@postgresql.org Subject: Re: BUG #6511: calling spi_exec_query from non-main package, results in: couldn't fetch $_TD References: <20120315221351.GB20113@momjian.us> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/125 X-Sequence-Number: 32686 On 03/16/12 13:48, Alex Hunsaker wrote: > On Thu, Mar 15, 2012 at 16:13, Bruce Momjian wrote: >> On Tue, Mar 06, 2012 at 09:08:25PM -0700, Alex Hunsaker wrote: >>> [ Calling a plperl trigger function from a plperl function ] >>> >>> Yeah, there were some optimization done for 9.1 to try and make calls >>> a bit faster. The problem is we are fetching "_TD" not "main::_TD", >>> which means we try to find and use $_TD from whatever the current >>> package is. This should only happen from a nested plperl to plperl >>> trigger where the outer call was in a different package, otherwise the >>> package is always main. >>> >>> The attached fixes it for me, It would be great if you could confirm that. >>> >>> Thanks for the report! >> So, should this be applied? > Yes, but I would like to get conformation that it fixes the issue. > Either way Ill probably just end up submitting it to the next commit > fest. (I know most commiters are still busy with the current one). Fixes the problem. Thanks. I always like one line fixes.