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

Re: [COMMITTERS] pgsql: Fix breakage from earlier plperl fix.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alex Hunsaker <badalex(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Fix breakage from earlier plperl fix.
Date: 2012-01-06 13:34:30
Message-ID: 4F06F866.1010806@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers

On 01/05/2012 10:59 PM, Alex Hunsaker wrote:
> 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.
>
> I didn't bother adding regression tests-- should I have?

[redirecting to -hackers]


I have several questions.

1. How much are we actually saving here? newSVsv() ought to be pretty 
cheap, no? I imagine it's pretty heavily used inside the interpreter.

2. Unless I'm insufficiently caffeinated right now, there's something 
wrong with this logic:

! 	if (SvREADONLY(sv)&&
! 			(type != SVt_IV ||
! 			type != SVt_NV ||
! 			type != SVt_PV))

3. The above is in any case almost certainly insufficient, because in my tests a typeglob didn't trigger SvREADONLY(), but did cause a crash.


And yes, we should possibly add a regression test or two. Of course, we can't use the cause of the original complaint ($^V) in them, though.
  

cheers

andrew





In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2012-01-06 14:29:39
Subject: Re: Poorly thought out code in vacuum
Previous:From: Michael BeattieDate: 2012-01-06 13:28:48
Subject: Re: FATAL: bogus data in lock file "postmaster.pid": ""

pgsql-committers by date

Next:From: Robert HaasDate: 2012-01-06 13:36:27
Subject: pgsql: Fix variable confusion in BufferSync().
Previous:From: Tom LaneDate: 2012-01-06 07:26:07
Subject: Re: pgsql: Fix breakage from earlier plperl fix.

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