summaryrefslogtreecommitdiff
path: root/sql/spatial.h
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2011-12-08 16:29:45 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2011-12-08 16:29:45 +0400
commitfc9d34cabf06038f930db356d53ed76dab5fdf0d (patch)
tree6572df0814ada1d7cdf7df86bd662d6abcbf7118 /sql/spatial.h
parentae480437ce98bbba8624e52833b8edbcc495b014 (diff)
downloadmariadb-git-fc9d34cabf06038f930db356d53ed76dab5fdf0d.tar.gz
bug #901655 ST_BUFFER asserts with a coplicated shape.
Coinciding nodes can appear as a result of DOUBLE inaccuracy. We should test that before we start the loop. Also the spatial relations can be calculated faster if we check MBR relations first. And we do have the shape's MBR-s now. per-file comments: sql/gcalc_slicescan.cc set_extent() method added. bug #901655 ST_BUFFER asserts with a coplicated shape. sql/gcalc_slicescan.h set_extent() method declared. bug #901655 ST_BUFFER asserts with a coplicated shape. sql/gcalc_tools.cc bug #901655 ST_BUFFER asserts with a coplicated shape. checks for equal nodes added. sql/item_geofunc.cc bug #901655 ST_BUFFER asserts with a coplicated shape. MBR for the shapes calculated, and MBR checks added before we start the heavy calculations. sql/spatial.h bug #901655 ST_BUFFER asserts with a coplicated shape. MBR::buffer() method implemented.
Diffstat (limited to 'sql/spatial.h')
-rw-r--r--sql/spatial.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/spatial.h b/sql/spatial.h
index d55fc639acc..3ca5ed9ae20 100644
--- a/sql/spatial.h
+++ b/sql/spatial.h
@@ -98,6 +98,13 @@ struct MBR
if (mbr->ymax > ymax)
ymax= mbr->ymax;
}
+ void buffer(double d)
+ {
+ xmin-= d;
+ ymin-= d;
+ xmax+= d;
+ ymax+= d;
+ }
int equals(const MBR *mbr)
{