summaryrefslogtreecommitdiff
path: root/sql/item_geofunc.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-10-18 14:11:55 +0400
committerAlexander Barkov <bar@mariadb.org>2017-10-18 14:11:55 +0400
commit30e7d6709f7fb0f70a07c80a1a06614ca23da5f4 (patch)
tree9ba11fd32d82ac5c1364a537532ac896c4dd2058 /sql/item_geofunc.cc
parent75aabd03d57f85d63d57b25a239b4f930a3ae3c0 (diff)
parent3bc094d32a360b7d51600cf11bc4ce24117ecb78 (diff)
downloadmariadb-git-30e7d6709f7fb0f70a07c80a1a06614ca23da5f4.tar.gz
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'sql/item_geofunc.cc')
-rw-r--r--sql/item_geofunc.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index 04952739e85..16d4cf7cefa 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -66,9 +66,9 @@ String *Item_func_geometry_from_text::val_str(String *str)
srid= (uint32)args[1]->val_int();
str->set_charset(&my_charset_bin);
+ str->length(0);
if (str->reserve(SRID_SIZE, 512))
return 0;
- str->length(0);
str->q_append(srid);
if ((null_value= !Geometry::create_from_wkt(&buffer, &trs, str, 0)))
return 0;
@@ -1323,6 +1323,8 @@ static int setup_relate_func(Geometry *g1, Geometry *g2,
}
else
func->repeat_expression(shape_a);
+ if (func->reserve_op_buffer(1))
+ return 1;
func->add_operation(op_matrix(nc%3), 1);
if (do_store_shapes)
{
@@ -1493,11 +1495,13 @@ longlong Item_func_spatial_precise_rel::val_int()
Gcalc_function::op_intersection, 2);
func.add_operation(Gcalc_function::op_internals, 1);
shape_a= func.get_next_expression_pos();
- if ((null_value= g1.store_shapes(&trn)))
+ if ((null_value= g1.store_shapes(&trn)) ||
+ func.reserve_op_buffer(1))
break;
func.add_operation(Gcalc_function::op_internals, 1);
shape_b= func.get_next_expression_pos();
- if ((null_value= g2.store_shapes(&trn)))
+ if ((null_value= g2.store_shapes(&trn)) ||
+ func.reserve_op_buffer(1))
break;
func.add_operation(Gcalc_function::v_find_t |
Gcalc_function::op_intersection, 2);
@@ -1732,6 +1736,8 @@ int Item_func_buffer::Transporter::single_point(double x, double y)
{
if (buffer_op == Gcalc_function::op_difference)
{
+ if (m_fn->reserve_op_buffer(1))
+ return 1;
m_fn->add_operation(Gcalc_function::op_false, 0);
return 0;
}