diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2011-06-30 18:18:27 +0500 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2011-06-30 18:18:27 +0500 |
commit | 4f49cdf8d303b431343bbc77428169fdfcaae34c (patch) | |
tree | 81fb0a27ab947f77fd74051cbac75846dfbd2f53 /sql/spatial.h | |
parent | b826c888417e258dc0da6b6c0d011960db38f4b9 (diff) | |
download | mariadb-git-4f49cdf8d303b431343bbc77428169fdfcaae34c.tar.gz |
fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION
If the result contains a polygon with a hole, consequitive shapes weren't calculated
properly, as the hole appeared as shape in the result, but actually it's a single shape
with the surrounding polygon. It's more natural to use the size of the result as
a border instead of the number of resulting shapes.
per-file comments:
mysql-test/r/gis-precise.result
fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION
test result updated.
mysql-test/t/gis-precise.test
fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION
test case added.
sql/spatial.cc
fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION
check the data lenght instead of number of shapes.
sql/spatial.h
fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION
check the data lenght instead of number of shapes.
Diffstat (limited to 'sql/spatial.h')
-rw-r--r-- | sql/spatial.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sql/spatial.h b/sql/spatial.h index 6f6c39b5b42..e8f230f9127 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -251,7 +251,7 @@ public: virtual uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res)=0; virtual uint init_from_opresult(String *bin, - const char *opres, uint32 n_shapes=1) + const char *opres, uint res_len) { return init_from_wkb(opres + 4, UINT_MAX32, wkb_ndr, bin) + 4; } virtual bool get_data_as_wkt(String *txt, const char **end) const=0; @@ -425,13 +425,7 @@ public: uint32 get_data_size() const; bool init_from_wkt(Gis_read_stream *trs, String *wkb); uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); - uint priv_init_from_opresult(String *bin, const char *opres, - uint32 n_shapes, uint32 *poly_shapes); - uint init_from_opresult(String *bin, const char *opres, uint32 n_shapes) - { - uint32 foo; - return priv_init_from_opresult(bin, opres, n_shapes, &foo); - } + uint init_from_opresult(String *bin, const char *opres, uint res_len); bool get_data_as_wkt(String *txt, const char **end) const; bool get_mbr(MBR *mbr, const char **end) const; int area(double *ar, const char **end) const; @@ -461,7 +455,7 @@ public: uint32 get_data_size() const; bool init_from_wkt(Gis_read_stream *trs, String *wkb); uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); - uint init_from_opresult(String *bin, const char *opres, uint32 n_shapes); + uint init_from_opresult(String *bin, const char *opres, uint res_len); bool get_data_as_wkt(String *txt, const char **end) const; bool get_mbr(MBR *mbr, const char **end) const; int num_geometries(uint32 *num) const; @@ -487,7 +481,7 @@ public: uint32 get_data_size() const; bool init_from_wkt(Gis_read_stream *trs, String *wkb); uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); - uint init_from_opresult(String *bin, const char *opres, uint32 n_shapes); + uint init_from_opresult(String *bin, const char *opres, uint res_len); bool get_data_as_wkt(String *txt, const char **end) const; bool get_mbr(MBR *mbr, const char **end) const; int num_geometries(uint32 *num) const; @@ -529,7 +523,7 @@ public: } int store_shapes(Gcalc_shape_transporter *trn) const; const Class_info *get_class_info() const; - uint init_from_opresult(String *bin, const char *opres, uint32 n_shapes); + uint init_from_opresult(String *bin, const char *opres, uint res_len); }; @@ -543,7 +537,7 @@ public: uint32 get_data_size() const; bool init_from_wkt(Gis_read_stream *trs, String *wkb); uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); - uint init_from_opresult(String *bin, const char *opres, uint32 n_shapes); + uint init_from_opresult(String *bin, const char *opres, uint res_len); bool get_data_as_wkt(String *txt, const char **end) const; bool get_mbr(MBR *mbr, const char **end) const; int num_geometries(uint32 *num) const; |