Commit e8b6c964 authored by unknown's avatar unknown

Fix for AsText() spatial function


sql/item_strfunc.cc:
  Fix for the case when argument args[0] and result str are the same strings
parent 48297dbf
...@@ -2128,12 +2128,16 @@ String *Item_func_as_text::val_str(String *str) ...@@ -2128,12 +2128,16 @@ String *Item_func_as_text::val_str(String *str)
{ {
String *wkt = args[0]->val_str(str); String *wkt = args[0]->val_str(str);
Geometry geom; Geometry geom;
str->length(0);
if ((null_value=(args[0]->null_value || if ((null_value=(args[0]->null_value ||
geom.create_from_wkb(wkt->ptr(),wkt->length()) || geom.create_from_wkb(wkt->ptr(),wkt->length()))))
geom.as_wkt(str)))) return 0;
str->length(0);
if ((null_value=geom.as_wkt(str)))
return 0; return 0;
return str; return str;
} }
......
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