pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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 14:51:59 -0400
Message-ID: <11053.1466362319@sss.pgh.pa.us> (raw)
In-Reply-To: <9953.1466360251@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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

... also, a quick review of all the LINE-related code in geo_ops.c
says that it's just *full* of bugs.  Aside from the issues already
mentioned:

line_recv fails to reject A=B=0
line_perp can get division by zero
silly coding in line_eq (A and B can't both be zero, no need to look at C)
line_distance ignores l1->A, suspicious
close_pl busted in same way as line_interpt_internal
close_ps ignores tmp->B, suspicious

I suspect that a lot of this code was originally written on the assumption
that vertical and horizontal lines would have B or A exactly -1
respectively.  Somewhere along the line that restriction got dropped,
but the code wasn't improved to cope.

			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



view thread (13+ messages)  latest in thread

Message-ID: <11053.1466362319@sss.pgh.pa.us>
Permalink:  ../11053.1466362319@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11053.1466362319@sss.pgh.pa.us

 · 

reply

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: <11053.1466362319@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> <11053.1466362319@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