Commit graph

22 commits

Author SHA1 Message Date
Alexey Botchkov
af084bcd78 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.

bug #986977 Assertion `!cur_p->event' failed in Gcalc_scan_iterator::arrange_event(int, int).
  The double->inernal coord conversion produced -0 (minus zero) on some data.
  That minus-zero produces invalid comparison results when compared agains plus-zero.
  So we fixed the gcalc_set_double() to avoid it.

per-file comments:
  mysql-test/r/gis-precise.result
        result updated.
  mysql-test/t/gis-precise.test
        tests for #977021 and #986977 added.
  sql/gcalc_slicescan.cc
        bug #986977. The gcalc_set_double fixed to not produce minus-zero.
  sql/item_geofunc.cc
        bug #977021. Add the NOOP for the disappearing features.
2012-04-29 18:08:11 +05:00
Alexey Botchkov
56125a3bce GIS issues fixed.
Failures on SUN Solaris. Buggy compiler there required some extra initialization
for variables. Then the 02 optimization leads to bugs when values set through the
pointer are not always taken into account. Finally, the (long long) / (long)
crashes there, the explicit typeconverstion added.
Failing innodb_plunin.innodb_gis.test fixed.

per-file comments:
  mysql-test/suite/innodb_plugin/t/innodb_gis.test
GIS issues fixed.
  sql/gcalc_slicescan.cc
GIS issues fixed.
  sql/gcalc_tools.cc
GIS issues fixed.
2011-12-16 10:21:46 +04:00
Alexey Botchkov
fc9d34cabf 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.
2011-12-08 16:29:45 +04:00
Alexey Botchkov
12e60c4989 Small fixes to make compilers happy. 2011-11-22 17:57:33 +04:00
Alexey Botchkov
ae0ebd8a6b Windows has no 'nearbyint' in libraries.
So removed.
2011-11-22 17:32:05 +04:00
Alexey Botchkov
5a4c91003a Fix for bug #809849 spatial operations must be KILL-able.
Checks for thd->killed state added to the long loops in geometry calculations.

per-file comments:
  sql/gcalc_slicescan.cc
Fix for bug #809849 spatial operations must be KILL-able.
        checks for TERMINATED_STATE added.
  sql/gcalc_slicescan.h
Fix for bug #809849 spatial operations must be KILL-able.
        defines added to include checks for termination in the
        library.
  sql/gcalc_tools.cc
Fix for bug #809849 spatial operations must be KILL-able.
        checks for TERMINATED_STATE added.
  sql/gcalc_tools.h
Fix for bug #809849 spatial operations must be KILL-able.
        TERMINATED_STATE pointers added.
  sql/item_geofunc.cc
Fix for bug #809849 spatial operations must be KILL-able.
  sql/item_geofunc.h
Fix for bug #809849 spatial operations must be KILL-able.
2011-11-20 12:30:43 +04:00
Alexey Botchkov
9cde33f9ef small fixes to make compiler happy. 2011-11-17 18:03:47 +04:00
Alexey Botchkov
45bb808c7e code cleanup. 2011-10-16 21:16:53 +05:00
Alexey Botchkov
248f2da679 GIS code cleanup. 2011-10-16 19:55:37 +05:00
Alexey Botchkov
486df97986 #define added 2011-10-14 18:37:40 +05:00
Alexey Botchkov
c34a8ed827 repeating calcualtions eliminated. 2011-10-14 17:57:07 +05:00
Alexey Botchkov
8432284d4f GIS code.
Forward calculations introduced.

per-file comments:
  sql/gcalc_slicescan.cc
  sql/gcalc_slicescan.h
  sql/gcalc_tools.cc
  sql/gcalc_tools.h
  sql/item_geofunc.cc
2011-10-14 16:10:55 +05:00
Alexey Botchkov
bf2deb5ed3 Copyright notices fixed. 2011-10-06 17:41:28 +05:00
Alexey Botchkov
0048f0b1ae Valgrind warning fixed.
Coordinate size limitation removed.

per-file comments:
  mysql-test/r/gis-precise.result
        test result updated.
  sql/gcalc_slicescan.cc
        Check coordinate extent to pick better precidion in the ::set_double()
  sql/gcalc_slicescan.h
        free_list() can lead to valgrind warnig. Fixed
  sql/gcalc_tools.cc
        free_list() call changed.
2011-10-05 14:45:39 +05:00
Alexey Botchkov
e99850774b GIS library code cleanup.
GCALC_DBUG_OFF and related infrastructure defined so we can enable/disable debugging conveniently.

per-file comments:
  sql/gcalc_slicescan.cc
GIS library code cleanup.
  sql/gcalc_slicescan.h
GIS library code cleanup.
  sql/gcalc_tools.cc
GIS library code cleanup.
  sql/gcalc_tools.h
GIS library code cleanup.
2011-10-04 15:01:21 +05:00
Alexey Botchkov
25b5019c34 bugs fixed
855253 Compiler error: gcalc_slicescan.cc:2036: error: suggest parentheses around comparison in operand of .|. in maria-5.3-gis
        850775 ST_AREA does not work on GEOMETRYCOLLECTIONs in maria-5.3-gis

per-file comments:
  mysql-test/r/gis.result
        test result updated.
  mysql-test/t/gis.test
        test case added for 850775.
  sql/gcalc_slicescan.cc
        compiler error fixed.
  sql/spatial.cc
        ST_AREA implementation for GEOMETRY_COLLECTION, POINT and LINESTRING.
  sql/spatial.h
        area() declarations added.
2011-09-21 09:29:37 +05:00
Alexey Botchkov
0249413a6a several bugs fixed here.
849789  Second assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis
        849791  Fourth assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos
        849789  Second assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis
        848901   Assertion `fabs(cur_isc->x-m_cur_intersection->x) + fabs(cur_isc->y-m_cur_intersection->y) < 0.000000000001' failed in Gcalc_scan_iterator::intersection_scan() in maria-5.3-gis
        
per-file comments:
  mysql-test/r/gis-precise.result
        test result updated.
  mysql-test/r/gis.result
        test result updated.
  sql/gcalc_slicescan.cc
        bugfixes.
  sql/gcalc_slicescan.h
        bugfixes.
  sql/gcalc_tools.cc
        bugfixes.
  sql/gcalc_tools.h
        bugfixes.
  sql/item_geofunc.cc
        bugfixes.
  sql/spatial.cc
        bugfixes.
2011-09-21 00:04:41 +05:00
Alexey Botchkov
b408b1bbbc Fix for bug #848901 Assertion `fabs(cur_isc->x-m_cur_intersection->x) + fabs(cur_isc->y-m_cur_intersection->y) < 0.000000000001' failed in Gcalc_scan_iterator::intersection_scan() in maria-5.3-gis
That assertion's check was too tight. Released it a bit.

per-file comments:
  mysql-test/r/gis-precise.result
        Fix for bug #848901
        test result updated.
  mysql-test/t/gis-precise.test
        Fix for bug #848901
        test case added.
  sql/gcalc_slicescan.cc
        Fix for bug #848901
        The DBUG_ASSERT check is too tight here.
2011-09-13 15:19:55 +05:00
Alexey Botchkov
3882c5d62c Fix for few similar bugs:
#841622 Assertion `t->rp->type == Gcalc_function::shape_line' failed in Gcalc_operation_reducer::end_line in maria-5.3-gi
  #841625 Assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis
  #841638 Assertion `!m_prev || m_prev->x != x || m_prev->y != y' failed in Gcalc_shape_transporter::int_add_point in maria-5.3-gis
  #841662 Third assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos
  #841745 Assertion `!sp0->is_bottom()' failed in Gcalc_scan_iterator::find_intersections in maria-5.3-gis

  They mostly was caused by inprecision of double arithmetic.
  Fixed by changes in how to handle multiple intersections to keep their order right.

  Also ST_DISTANCE(GEOM, EMPTY_GEOM) was defined as NULL.


per-file comments:
  mysql-test/r/gis-precise.result
   GIS bugfixes.
        test result updated.
  mysql-test/t/gis-precise.test
   GIS bugfixes.
        test cases added.
  sql/gcalc_slicescan.cc
   GIS bugfixes.
        If intersections are close, add order checks to cope with the
        double calcualtions imprecision.
  sql/gcalc_slicescan.h
   GIS bugfixes.
        n_row parameter added to intersection to check their order.
  sql/item_geofunc.cc
   GIS bugfixes.
        ST_DISTANCE(GEOM, EMPTY_GEOM) returns NULL.
2011-09-13 13:59:11 +05:00
Alexey Botchkov
152f3c5e28 PostGIS-style 'same point' handling. 2011-09-01 11:44:56 +05:00
Alexey Botchkov
13f6e1119f Fix for bug #804324 Assertion 0 in Gcalc_scan_iterator::pop_suitable_intersection
There were actually two bugs. One was when the line that intersects itself
        the intersection point treated as it doesn't belong to the line.
        Second when edges partly coincide, wrong result produced when we try to find their
        intersection.


per-file comments:
  mysql-test/r/gis-precise.result
Fix for bug #804324 Assertion 0 in Gcalc_scan_iterator::pop_suitable_intersection
        test result updated.

  mysql-test/t/gis-precise.test
Fix for bug #804324 Assertion 0 in Gcalc_scan_iterator::pop_suitable_intersection
        test case added.

  sql/gcalc_slicescan.cc
Fix for bug #804324 Assertion 0 in Gcalc_scan_iterator::pop_suitable_intersection
        skip the intersection if it just line that intersects itself.

  sql/gcalc_tools.cc
Fix for bug #804324 Assertion 0 in Gcalc_scan_iterator::pop_suitable_intersection
        if edges coincide, just pick the first coinciding poing as an intersection.
2011-07-07 16:59:45 +05:00
Alexey Botchkov
788043cd0b Precise GIS functions added. 2011-05-04 23:20:17 +05:00