summaryrefslogtreecommitdiff
path: root/sql/item_geofunc.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-02-18 17:15:57 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2015-02-18 17:15:57 -0500
commit3c9137deeb84dff9fa52734fb5fc3966c6746c00 (patch)
tree3ce5922ee55d6683c2348e1b1772d961754d1cd6 /sql/item_geofunc.cc
parentd8ee54c63321e81ef99465bbadc8e4fb45fe7569 (diff)
parentfdd6c111c254c5044cd9b6c2f7e4d0c74f427a79 (diff)
downloadmariadb-git-3c9137deeb84dff9fa52734fb5fc3966c6746c00.tar.gz
Merge branch '5.5' into 5.5-galera
Merge banch 5.5 till revision : fdd6c11 - MDEV-7419 Function cli_safe_read not exported Conflicts: .bzrignore debian/dist/Debian/mariadb-galera-server-5.5.files.in debian/dist/Ubuntu/mariadb-galera-server-5.5.files.in storage/tokudb/CMakeLists.txt support-files/build-tags
Diffstat (limited to 'sql/item_geofunc.cc')
-rw-r--r--sql/item_geofunc.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index a38e9d416a7..5e1c0add54b 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -1286,6 +1286,13 @@ String *Item_func_buffer::val_str(String *str_value)
if (dist > 0.0)
mbr.buffer(dist);
+ else
+ {
+ /* This happens when dist is too far negative. */
+ if (mbr.xmax + dist < mbr.xmin || mbr.ymax + dist < mbr.ymin)
+ goto return_empty_result;
+ }
+
collector.set_extent(mbr.xmin, mbr.xmax, mbr.ymin, mbr.ymax);
/*
If the distance given is 0, the Buffer function is in fact NOOP,
@@ -1313,6 +1320,7 @@ String *Item_func_buffer::val_str(String *str_value)
goto mem_error;
+return_empty_result:
str_value->set_charset(&my_charset_bin);
if (str_value->reserve(SRID_SIZE, 512))
goto mem_error;