Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEhpG-0006SP-Tz for pgsql-bugs@arkaria.postgresql.org; Sun, 19 Jun 2016 18:52:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bEhpG-0002UB-3b for pgsql-bugs@arkaria.postgresql.org; Sun, 19 Jun 2016 18:52:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bEhpE-0002U2-DX for pgsql-bugs@postgresql.org; Sun, 19 Jun 2016 18:52:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bEhpB-0007gm-AD for pgsql-bugs@postgresql.org; Sun, 19 Jun 2016 18:52:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u5JIpxqL011054; Sun, 19 Jun 2016 14:51:59 -0400 From: Tom Lane To: emre@hasegeli.com cc: PostgreSQL Bugs Subject: Re: Line intersection point is wrong In-reply-to: <9953.1466360251@sss.pgh.pa.us> References: <14750.1466353137@sss.pgh.pa.us> <9953.1466360251@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 19 Jun 2016 14:17:31 -0400" Date: Sun, 19 Jun 2016 14:51:59 -0400 Message-ID: <11053.1466362319@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org ... 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