summaryrefslogtreecommitdiff
path: root/sql/item_geofunc.cc
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2004-09-07 16:44:25 +0500
committerunknown <hf@deer.(none)>2004-09-07 16:44:25 +0500
commit871c5c0175cc579f355202464f9f858b473a9357 (patch)
tree4154305384dcc8f2ec6774749005a7bda6767bdd /sql/item_geofunc.cc
parent8f3564d02d4e65f3fc5d22d10f3e58473b15959f (diff)
downloadmariadb-git-871c5c0175cc579f355202464f9f858b473a9357.tar.gz
Fix for bug #5136(Geometry object corrupted after the query)
sql/item_geofunc.cc: We should force geometry's charset to be BINARY
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 9d58cc37c2a..790fdcd5cd1 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -44,6 +44,7 @@ String *Item_func_geometry_from_text::val_str(String *str)
if ((arg_count == 2) && !args[1]->null_value)
srid= (uint32)args[1]->val_int();
+ str->set_charset(&my_charset_bin);
if (str->reserve(SRID_SIZE, 512))
return 0;
str->length(0);
@@ -71,6 +72,7 @@ String *Item_func_geometry_from_wkb::val_str(String *str)
if ((arg_count == 2) && !args[1]->null_value)
srid= (uint32)args[1]->val_int();
+ str->set_charset(&my_charset_bin);
if (str->reserve(SRID_SIZE, 512))
return 0;
str->length(0);
@@ -180,6 +182,7 @@ String *Item_func_envelope::val_str(String *str)
return 0;
srid= uint4korr(swkb->ptr());
+ str->set_charset(&my_charset_bin);
str->length(0);
if (str->reserve(SRID_SIZE, 512))
return 0;
@@ -202,6 +205,7 @@ String *Item_func_centroid::val_str(String *str)
swkb->length() - SRID_SIZE))))
return 0;
+ str->set_charset(&my_charset_bin);
if (str->reserve(SRID_SIZE, 512))
return 0;
str->length(0);
@@ -232,6 +236,7 @@ String *Item_func_spatial_decomp::val_str(String *str)
return 0;
srid= uint4korr(swkb->ptr());
+ str->set_charset(&my_charset_bin);
if (str->reserve(SRID_SIZE, 512))
goto err;
str->length(0);
@@ -279,6 +284,7 @@ String *Item_func_spatial_decomp_n::val_str(String *str)
swkb->length() - SRID_SIZE)))))
return 0;
+ str->set_charset(&my_charset_bin);
if (str->reserve(SRID_SIZE, 512))
goto err;
srid= uint4korr(swkb->ptr());
@@ -333,6 +339,7 @@ String *Item_func_point::val_str(String *str)
str->realloc(1 + 4 + SIZEOF_STORED_DOUBLE*2))))
return 0;
+ str->set_charset(&my_charset_bin);
str->length(0);
str->q_append((char)Geometry::wkb_ndr);
str->q_append((uint32)Geometry::wkb_point);
@@ -358,6 +365,7 @@ String *Item_func_spatial_collection::val_str(String *str)
String arg_value;
uint i;
+ str->set_charset(&my_charset_bin);
str->length(0);
if (str->reserve(1 + 4 + 4, 512))
goto err;