Re: numeric regression test passes, but why?

From: Sergei Kornilov <sk(at)zsrv(dot)org>
To: Chapman Flack <chap(at)anastigmatix(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: numeric regression test passes, but why?
Date: 2018-01-11 12:44:44
Message-ID: 405071515674684@web31j.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello
I am surprised, but i can confirm error on versions prior 9.6: on 9.5, 9.4, 9.3 same error. On 9.6 and 10 query works correctly
All checked postgresql are x86_64 from postgresql debian repository: http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main

postgres=# select 0.5678::numeric operator(pg_catalog.^) (-85::numeric);
ERROR: division by zero
postgres=# select version();
version
-------------------------------------------------------------------------------------------
PostgreSQL 9.5.10 on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit

Regards, Sergei

11.01.2018, 15:27, "Chapman Flack" <chap(at)anastigmatix(dot)net>:
> On 01/11/18 02:07, Tom Lane wrote:
>
>>  Hm, it won't help your sanity to know that those cases pass fine
>>  for me, interactively, on a couple of different machines:
>>  ...
>>  You sure you're using a stock build of Postgres? No handmade
>>  versions of operator ^ lying around?
>
> Interesting thought....
>
> At $work:
> postgresql95-server.x86_64 9.5.10-1PGDG.rhel7 @pgdg95
>
> postgres=> select 0.5678 operator(pg_catalog.^) (-85);
> ERROR: division by zero
> postgres=> select 0.5678::numeric operator(pg_catalog.^) (-85::numeric);
> ERROR: division by zero
>
> Also at home in a gentoo 9.5.1 ebuild...
> Also in a build from e35dba475a440f73dccf9ed1fd61e3abc6ee61db in git.
>
> All x86_64 ....
>
> -Chap

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-01-11 12:46:50 Re: add queryEnv to ExplainOneQuery_hook
Previous Message Marina Polyakova 2018-01-11 12:42:22 Re: WIP Patch: Pgbench Serialization and deadlock errors