[Commits] Rev 3606: Yet another ST_ConvexHull fix. in file:///home/hf/wmar/5.3-gis/

holyfoot at askmonty.org holyfoot at askmonty.org
Fri Nov 30 14:47:52 EET 2012


At file:///home/hf/wmar/5.3-gis/

------------------------------------------------------------
revno: 3606
revision-id: holyfoot at askmonty.org-20121130123942-pwg3uk90ycwahu4b
parent: holyfoot at askmonty.org-20121130103337-x0deikajst3z5rsr
committer: Alexey Botchkov <holyfoot at askmonty.org>
branch nick: 5.3-gis
timestamp: Fri 2012-11-30 16:39:42 +0400
message:
  Yet another ST_ConvexHull fix.
-------------- next part --------------
=== modified file 'mysql-test/r/gis-precise.result'
--- a/mysql-test/r/gis-precise.result	2012-11-30 10:33:37 +0000
+++ b/mysql-test/r/gis-precise.result	2012-11-30 12:39:42 +0000
@@ -227,6 +227,9 @@ POLYGON((10 0,7 3,0 14,10 16,15 15,14 7,
 select astext(st_convexhull(GeomFromText('POLYGON((10 0, 7 3, 15 6, 0 14, 10 16, 15 15, 12 10, 14 7, 10 0))')));
 astext(st_convexhull(GeomFromText('POLYGON((10 0, 7 3, 15 6, 0 14, 10 16, 15 15, 12 10, 14 7, 10 0))')))
 POLYGON((10 0,7 3,0 14,10 16,15 15,15 6,10 0))
+SELECT AsText(ST_ConvexHull(GeomFromText('POLYGON(( 10 0,  9 8,  3 9,  5 3,  10 5,  2 5,  10 0))')));
+AsText(ST_ConvexHull(GeomFromText('POLYGON(( 10 0,  9 8,  3 9,  5 3,  10 5,  2 5,  10 0))')))
+POLYGON((10 0,5 3,2 5,3 9,9 8,10 5,10 0))
 select st_relate(Geomfromtext('POLYGON((0 0, 0 1, 1 0, 0 0))'), GEOMfromtext('POLYGON((0 0, 1 1, 0 1, 0 0))'), 'T*******T');
 st_relate(Geomfromtext('POLYGON((0 0, 0 1, 1 0, 0 0))'), GEOMfromtext('POLYGON((0 0, 1 1, 0 1, 0 0))'), 'T*******T')
 1

=== modified file 'mysql-test/t/gis-precise.test'
--- a/mysql-test/t/gis-precise.test	2012-11-30 10:33:37 +0000
+++ b/mysql-test/t/gis-precise.test	2012-11-30 12:39:42 +0000
@@ -118,6 +118,7 @@ SELECT AsText(ST_ConvexHull(GeomFromText
 select astext(st_convexhull(GeomFromText('POLYGON((0 0, 0 1, 1 0, 0 0))')));
 select astext(st_convexhull(GeomFromText('POLYGON((10 0, 7 3, 10 6, 0 14, 10 16, 15 15, 12 10, 14 7, 10 0))')));
 select astext(st_convexhull(GeomFromText('POLYGON((10 0, 7 3, 15 6, 0 14, 10 16, 15 15, 12 10, 14 7, 10 0))')));
+SELECT AsText(ST_ConvexHull(GeomFromText('POLYGON(( 10 0,  9 8,  3 9,  5 3,  10 5,  2 5,  10 0))')));
 
 # Relate test
 select st_relate(Geomfromtext('POLYGON((0 0, 0 1, 1 0, 0 0))'), GEOMfromtext('POLYGON((0 0, 1 1, 0 1, 0 0))'), 'T*******T');

=== modified file 'sql/item_geofunc.cc'
--- a/sql/item_geofunc.cc	2012-11-30 10:33:37 +0000
+++ b/sql/item_geofunc.cc	2012-11-30 12:39:42 +0000
@@ -464,7 +464,7 @@ String *Item_func_convexhull::val_str(St
 
     {
       Gcalc_point_iterator pit(&scan_it);
-      if (!pit.point() || pit.point()->event)
+      if (!pit.point() || scan_it.get_event_position() == pit.point())
       {
         /* Handle left part of the hull. */
         if (add_node_to_line(&left_cur, 1, ev->pi))
@@ -476,7 +476,8 @@ String *Item_func_convexhull::val_str(St
         for(; pit.point()->c_get_next(); ++pit)
           ;
       }
-      if (!pit.point() || pit.point()->event)
+      if (!pit.point() || pit.point()->event ||
+          scan_it.get_event_position() == pit.point()->c_get_next())
       {
         /* Handle right part of the hull. */
         if (add_node_to_line(&right_cur, -1, ev->pi))



More information about the commits mailing list