[Commits] Rev 3365: bug #977021 ST_BUFFER fails with the negative D. in file:///home/hf/wmar/gis-work/

holyfoot at askmonty.org holyfoot at askmonty.org
Mon Apr 9 16:20:25 EEST 2012


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

------------------------------------------------------------
revno: 3365
revision-id: holyfoot at askmonty.org-20120409130729-2l6lxvcuieky1vpv
parent: sergii at pisem.net-20120405135727-1kxtscd76rq6xw5o
committer: Alexey Botchkov <holyfoot at askmonty.org>
branch nick: gis-work
timestamp: Mon 2012-04-09 18:07:29 +0500
message:
  bug #977021 ST_BUFFER fails with the negative D.
          Points and lines should disappear if we got negative D.
          To make it work properly inside the GEOMETRYCOLLECTION,
          we add the empty operation there.
-------------- next part --------------
=== modified file 'mysql-test/r/gis-precise.result'
--- a/mysql-test/r/gis-precise.result	2011-11-27 16:46:20 +0000
+++ b/mysql-test/r/gis-precise.result	2012-04-09 13:07:29 +0000
@@ -434,3 +434,6 @@
 SELECT ST_INTERSECTS( GeomFromText('MULTILINESTRING( ( 4030 3045 , 3149 2461 , 3004 3831 , 3775 2976 ) )') , GeomFromText('LINESTRING(3058.41 3187.91,3081.52 3153.19,3042.99 3127.57,3019.89 3162.29,3039.07 3175.05,3039.07 3175.05,3058.41 3187.91,3081.52 3153.19,3042.99 3127.57,3019.89 3162.29)') );
 ST_INTERSECTS( GeomFromText('MULTILINESTRING( ( 4030 3045 , 3149 2461 , 3004 3831 , 3775 2976 ) )') , GeomFromText('LINESTRING(3058.41 3187.91,3081.52 3153.19,3042.99 3127.57,3019.89 3162.29,3039.07 3175.05,3039.07 3175.05,3058.41 3187.91,3081.52 3153.19,
 1
+select ASTEXT(ST_BUFFER(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 31 10, 77 80), POLYGON((0 0,4 7,1 1,0 0)), POINT(20 20))'), -3));
+ASTEXT(ST_BUFFER(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 31 10, 77 80), POLYGON((0 0,4 7,1 1,0 0)), POINT(20 20))'), -3))
+POLYGON((3.999999999999999 6.999999999999998,4 7,3.999999999999999 6.999999999999998))

=== modified file 'mysql-test/t/gis-precise.test'
--- a/mysql-test/t/gis-precise.test	2011-11-24 12:26:13 +0000
+++ b/mysql-test/t/gis-precise.test	2012-04-09 13:07:29 +0000
@@ -313,3 +313,6 @@
 
 SELECT ST_INTERSECTS( GeomFromText('MULTILINESTRING( ( 4030 3045 , 3149 2461 , 3004 3831 , 3775 2976 ) )') , GeomFromText('LINESTRING(3058.41 3187.91,3081.52 3153.19,3042.99 3127.57,3019.89 3162.29,3039.07 3175.05,3039.07 3175.05,3058.41 3187.91,3081.52 3153.19,3042.99 3127.57,3019.89 3162.29)') );
 
+#bug 977201 ST_BUFFER fails with the negative D
+select ASTEXT(ST_BUFFER(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 31 10, 77 80), POLYGON((0 0,4 7,1 1,0 0)), POINT(20 20))'), -3));
+

=== modified file 'sql/item_geofunc.cc'
--- a/sql/item_geofunc.cc	2012-01-13 14:50:02 +0000
+++ b/sql/item_geofunc.cc	2012-04-09 13:07:29 +0000
@@ -1010,6 +1010,13 @@
 
 int Item_func_buffer::Transporter::single_point(double x, double y)
 {
+  if (buffer_op == Gcalc_function::op_difference)
+  {
+    m_fn->add_operation(Gcalc_function::op_false, 0);
+    return 0;
+  }
+  
+  m_nshapes= 0;
   return add_point_buffer(x, y);
 }
 
@@ -1109,6 +1116,7 @@
 {
   if (buffer_op == Gcalc_function::op_difference)
   {
+    m_fn->add_operation(Gcalc_function::op_false, 0);
     skip_line= TRUE;
     return 0;
   }



More information about the commits mailing list