From: Tom Lane <tgl@sss.pgh.pa.us>
To: emre@hasegeli.com
Cc: PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: Line intersection point is wrong
Date: Sun, 19 Jun 2016 16:16:42 -0400
Message-ID: <18081.1466367402@sss.pgh.pa.us> (raw)
In-Reply-To: <CAE2gYzxrfOaje7D6vWJvs0FnmFE4MEEcfyb=O6EDzgzC64GzxA@mail.gmail.com>
References: <CAE2gYzw_-z=V2kh8QqFjenu=8MJXzOP44wRW=AzzeamrmTT1=Q@mail.gmail.com>
<14750.1466353137@sss.pgh.pa.us>
<CAE2gYzyi_XkC4YdBj3E+a+7xYfOg0AR=sZsSCEWuYNFVmp+fCw@mail.gmail.com>
<9953.1466360251@sss.pgh.pa.us>
<CAE2gYzxrfOaje7D6vWJvs0FnmFE4MEEcfyb=O6EDzgzC64GzxA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Emre Hasegeli <emre@hasegeli.com> writes:
>> Hmm, well, what if we change line_parallel() so that what it tests
>> is whether (l1->A * l2->B - l2->A * l1->B) is zero? That seems
>> simpler and more symmetric than what it does now.
> I was thinking to do so. I would also check for both sides not to
> overflow, but that can wait. Patch attached. Unfortunately,
> the change causes too much noise on the regression tests.
I don't think this is right:
+ x = (l1->B * l2->C - l2->B * l1->C) / (l1->A * l2->B - l2->A * l1->B);
+ y = (l1->A * x + l1->C) / l1->B;
You haven't done anything to exclude the possibility that l1->B is zero,
so you could be getting zero-divide in the y calculation.
FWIW, given that you're claiming the calculation is wrong as-is, there
is no particularly good reason to assume that the expected results
embedded in select_views.out are correct :-(. I doubt anyone's ever
tried to verify those independently.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, emre@hasegeli.com
Subject: Re: Line intersection point is wrong
In-Reply-To: <18081.1466367402@sss.pgh.pa.us>
References: <CAE2gYzw_-z=V2kh8QqFjenu=8MJXzOP44wRW=AzzeamrmTT1=Q@mail.gmail.com> <14750.1466353137@sss.pgh.pa.us> <CAE2gYzyi_XkC4YdBj3E+a+7xYfOg0AR=sZsSCEWuYNFVmp+fCw@mail.gmail.com> <9953.1466360251@sss.pgh.pa.us> <CAE2gYzxrfOaje7D6vWJvs0FnmFE4MEEcfyb=O6EDzgzC64GzxA@mail.gmail.com> <18081.1466367402@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox