Re: Plperl Safe version check fails for Safe 2.09

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <markir(at)coretech(dot)co(dot)nz>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Plperl Safe version check fails for Safe 2.09
Date: 2004-11-24 17:29:19
Message-ID: 2473.24.211.141.25.1101317359.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane said:
> Mark Kirkwood <markir(at)coretech(dot)co(dot)nz> writes:
>> It seems that the check in src/pl/plperl/plperl.c
>> eval_pv((safe_version < 2.09 ? safe_bad : safe_ok), FALSE);
>> is not working quite as expected (CVS HEAD from today):
>
> Yah know, I looked at that on Monday and said to myself "Self, that
> looks like a rounding problem waiting to happen" ... but in the absence
> of a trouble report didn't want to mess with it.
>
> Part of the problem is that Perl NV is double, not float, and so the
> declaration of safe_version is wrong on its face. But even with it
> properly declared, exact comparison of double values is playing with
> fire. I'd be inclined to change it to something like
>
> double safe_version;
> ...
> if (safe_version < 2.0899999) ...
>

Since there was no released version between 2.08 and 2.09, comparing to
2.085 should do the trick (or any of 2.08[1-9]).

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Barry Lind 2004-11-24 17:49:40 Re: [JDBC] Strange server error with current 8.0beta driver
Previous Message Gavin M. Roy 2004-11-24 17:28:31 Re: Beta5 now Available