Re: Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)me>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c
Date: 2016-03-27 22:22:04
Message-ID: 11392.1459117324@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)me> writes:
> On the exact same note, something like this (again reduced from what
> sqlsmith produced):
> leads to vardata.rel->tuples being zero here:
> if (vardata.rel)
> ndistinct *= vardata.rel->rows / vardata.rel->tuples;

Ugh. That's a bit worse because it'll be 0/0, ie you get a NaN.
Thanks for the report.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2016-03-27 23:25:09 Re: silent data loss with ext4 / all current versions
Previous Message Tom Lane 2016-03-27 22:08:40 Re: Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c