Re: numeric regression test passes, but why?

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: numeric regression test passes, but why?
Date: 2018-01-11 16:30:53
Message-ID: c60a9b64-a1ba-d470-28a6-dcc29a2954fe@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/11/2018 11:23 AM, Alvaro Herrera wrote:
> Dagfinn Ilmari Mannsåker wrote:
>> ilmari(at)ilmari(dot)org (Dagfinn Ilmari Mannsåker) writes:
>>
>>> The behaviour seems to have changed in 9.6:
>>
>> Indeed, https://www.postgresql.org/docs/current/static/release-9-6.html
>> has the following entry:
>>
>> * Improve the accuracy of the ln(), log(), exp(), and pow() functions
>> for type numeric (Dean Rasheed)
>
> Well, the test line was added with that commit (7d9a4737c268), and
> indeed its comment says this used to fail:
>
> +-- cases that used to error out
> +select 0.12 ^ (-25);
> + ?column?
> +-------------------------------------------
> + 104825960103961013959336.4983657883169110
> +(1 row)

And indeed, my starting message in this thread was that, even in my
recent (e35dba475a440f73dccf9ed1fd61e3abc6ee61db) build, make check
*succeeds*, and for all I can tell, that test *is* executed (it shows
up in the log, and if I re-run it with digits altered, it fails).

And then I can connect interactively to the same server (started
fresh, not the same instance 'make check' was running, haven't tried
to find a way to connect to that), issue the same select, and get
the division by zero.

This is somehow sensitive to some sort of state. But what sort?

-Chap

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rader, David 2018-01-11 16:47:52 [PATCH] ECPG bug fix in preproc when indicator struct is shorter than record struct
Previous Message Alvaro Herrera 2018-01-11 16:25:22 Re: Identifying ALTER TABLE "sub-command"