]> granicus.if.org Git - postgresql/commit
Fix line_construct_pm() for the case of "infinite" (DBL_MAX) slope.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 10 Nov 2010 21:51:39 +0000 (16:51 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 10 Nov 2010 21:55:07 +0000 (16:55 -0500)
commit5154ebad98acd6a3b7aa0a196654b0244429cb98
tree0e3268d3501d9e1a83c4f0edfc2a272777844b5a
parent1d5edff1b0a67fe75946ba8ff58d93b13de77e54
Fix line_construct_pm() for the case of "infinite" (DBL_MAX) slope.

This code was just plain wrong: what you got was not a line through the
given point but a line almost indistinguishable from the Y-axis, although
not truly vertical.  The only caller that tries to use this function with
m == DBL_MAX is dist_ps_internal for the case where the lseg is horizontal;
it would end up producing the distance from the given point to the place
where the lseg's line crosses the Y-axis.  That function is used by other
operators too, so there are several operators that could compute wrong
distances from a line segment to something else.  Per bug #5745 from
jindiax.

Back-patch to all supported branches.
src/backend/utils/adt/geo_ops.c