Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Fix breakage from earlier plperl fix.

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-committers(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Fix breakage from earlier plperl fix.
Date: 2012-01-06 03:59:33
Message-ID: CAFaPBrT3AOzrKHZJ=2P5aD+kEXEKEgaBHwLJB_uqqnXBHKProw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
On Thu, Jan 5, 2012 at 16:59, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
>
> On 01/05/2012 06:31 PM, Alex Hunsaker wrote:
>>
>> On Thu, Jan 5, 2012 at 16:02, Andrew Dunstan<andrew(at)dunslane(dot)net>  wrote:
>>>
>>> Fix breakage from earlier plperl fix.

>> I can't help but think this seems a bit inefficient
>
> So, yes, we should probably adjust this one more time, but ideally we need a
> better test than just SvREADONLY(). If you want to follow up your
> investigation of exactly when we need a copied SV and see how much you can
> narrow it down that would be great.

After further digging I found it chokes on any non scalar (IOW any
reference). I attached a simple c program that I tested with 5.8.9,
5.10.1, 5.12.4 and 5.14.2 (for those who did not know about it,
perlbrew made testing across all those perls relatively painless).

PFA that copies if its readonly and its not a scalar. Also I fixed up
Tom's complaint about having sv2cstr() inside do_util_elog's PG_TRY
block. I didn't bother fixing the ones in plperl.c tho-- some seemed
like they would require quite a bit of rejiggering.

I didn't bother adding regression tests-- should I have?

Attachment: svutf8_ro_test.c
Description: text/x-csrc (926 bytes)
Attachment: svutf8_fix3.patch
Description: text/x-patch (2.2 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2012-01-06 07:26:07
Subject: Re: pgsql: Fix breakage from earlier plperl fix.
Previous:From: Stephen FrostDate: 2012-01-06 01:10:17
Subject: Re: 16-bit page checksums for 9.2

pgsql-committers by date

Next:From: Tom LaneDate: 2012-01-06 07:26:07
Subject: Re: pgsql: Fix breakage from earlier plperl fix.
Previous:From: Andrew DunstanDate: 2012-01-05 23:59:53
Subject: Re: pgsql: Fix breakage from earlier plperl fix.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group