summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2013-03-06 01:45:25 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2013-03-06 01:45:25 +0400
commit7fb55ee807937ab78c95cf247747c5711449fc20 (patch)
tree4b8c1eba52e2628adab82a403bba7f434d298fca /mysql-test
parentab1c228836b81659e859298096ef163dca8117b5 (diff)
downloadmariadb-git-7fb55ee807937ab78c95cf247747c5711449fc20.tar.gz
TODO-424 geometry query crashes server.
The bug was found by Alyssa Milburn. If the number of points of a geometry feature read from binary representation is greater than 0x10000000, then the (uint32) (num_points * 16) will cut the higher byte, which leads to various errors. Fixed by additional check if (num_points > max_n_points).
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/gis.result15
-rw-r--r--mysql-test/t/gis.test7
2 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 9253270a79e..906ed3f9338 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -1498,4 +1498,19 @@ create table t1 (pt point);
insert into t1 values(Geomfromtext('POLYGON((1 1, 2 2, 2 1, 1 1))'));
ERROR 22007: Incorrect POINT value: 'POLYGON' for column 'pt' at row 1
drop table t1;
+#
+# TODO-424 geometry query crashes server
+#
+select astext(0x0100000000030000000100000000000010);
+astext(0x0100000000030000000100000000000010)
+NULL
+select st_area(0x0100000000030000000100000000000010);
+st_area(0x0100000000030000000100000000000010)
+NULL
+select astext(st_exteriorring(0x0100000000030000000100000000000010));
+astext(st_exteriorring(0x0100000000030000000100000000000010))
+NULL
+select astext(st_centroid(0x0100000000030000000100000000000010));
+astext(st_centroid(0x0100000000030000000100000000000010))
+NULL
End of 5.5 tests
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 188cba004df..190445e9c09 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -1367,4 +1367,11 @@ create table t1 (pt point);
insert into t1 values(Geomfromtext('POLYGON((1 1, 2 2, 2 1, 1 1))'));
drop table t1;
+--echo #
+--echo # TODO-424 geometry query crashes server
+--echo #
+select astext(0x0100000000030000000100000000000010);
+select st_area(0x0100000000030000000100000000000010);
+select astext(st_exteriorring(0x0100000000030000000100000000000010));
+select astext(st_centroid(0x0100000000030000000100000000000010));
--echo End of 5.5 tests