Commit 7f55ea12 authored by Alexey Botchkov's avatar Alexey Botchkov

fix for bug #801212 Assertion with ST_INTERSECTION on NULL values

        The ::val_str() method has to return NULL if it calculated
        the null_value, not just set the related flag.

per-file comments:
  mysql-test/r/gis-precise.result
fix for bug #801212 Assertion with ST_INTERSECTION on NULL values
        test result updated.
  mysql-test/t/gis-precise.test
fix for bug #801212 Assertion with ST_INTERSECTION on NULL values
        test case added.
  sql/item_geofunc.cc
fix for bug #801212 Assertion with ST_INTERSECTION on NULL values
        return NULL from the val_str if we get the null_value.
parent 0e6c889c
...@@ -215,3 +215,6 @@ LINESTRING(0 0,1 1) ...@@ -215,3 +215,6 @@ LINESTRING(0 0,1 1)
SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5); SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5);
Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5) Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5)
78.68426 78.68426
SELECT ST_INTERSECTION(NULL, NULL);
ST_INTERSECTION(NULL, NULL)
NULL
...@@ -115,5 +115,9 @@ SELECT astext(ST_UNION ( ...@@ -115,5 +115,9 @@ SELECT astext(ST_UNION (
#bug 801189 ST_BUFFER asserts if radius = 0 #bug 801189 ST_BUFFER asserts if radius = 0
SELECT astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0)); SELECT astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0));
#buf 801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT #bug 801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT
SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5); SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5);
#bug 801212 Assertion with ST_INTERSECTION on NULL values
SELECT ST_INTERSECTION(NULL, NULL);
...@@ -1014,7 +1014,10 @@ String *Item_func_spatial_operation::val_str(String *str_value) ...@@ -1014,7 +1014,10 @@ String *Item_func_spatial_operation::val_str(String *str_value)
!(g1= Geometry::construct(&buffer1, res1->ptr(), res1->length())) || !(g1= Geometry::construct(&buffer1, res1->ptr(), res1->length())) ||
!(g2= Geometry::construct(&buffer2, res2->ptr(), res2->length())) || !(g2= Geometry::construct(&buffer2, res2->ptr(), res2->length())) ||
g1->store_shapes(&trn) || g2->store_shapes(&trn)))) g1->store_shapes(&trn) || g2->store_shapes(&trn))))
{
str_value= 0;
goto exit; goto exit;
}
collector.prepare_operation(); collector.prepare_operation();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment