Commit 05de9d5f authored by hf@deer.mysql.r18.ru's avatar hf@deer.mysql.r18.ru

Spatial-related fixes

parent dbc8dca8
......@@ -21,6 +21,7 @@ heikki@donna.mysql.fi
heikki@hundin.mysql.fi
heikki@rescue.
heikki@work.mysql.com
hf@deer.mysql.r18.ru
hf@genie.(none)
jani@dsl-jkl1657.dial.inet.fi
jani@hynda.(none)
......
......@@ -2436,7 +2436,8 @@ General functions for spatial objects
String *Item_func_geometry_from_text::val_str(String *str)
{
Geometry geom;
String *wkt = args[0]->val_str(str);
String arg_val;
String *wkt = args[0]->val_str(&arg_val);
GTextReadStream trs(wkt->ptr(), wkt->length());
str->length(0);
......@@ -2454,7 +2455,8 @@ void Item_func_geometry_from_text::fix_length_and_dec()
String *Item_func_as_text::val_str(String *str)
{
String *wkt = args[0]->val_str(str);
String arg_val;
String *wkt = args[0]->val_str(&arg_val);
Geometry geom;
if ((null_value=(args[0]->null_value ||
......@@ -2491,7 +2493,8 @@ String *Item_func_geometry_type::val_str(String *str)
String *Item_func_envelope::val_str(String *str)
{
String *wkb = args[0]->val_str(str);
String arg_val;
String *wkb = args[0]->val_str(&arg_val);
Geometry geom;
null_value = args[0]->null_value ||
......@@ -2504,7 +2507,8 @@ String *Item_func_envelope::val_str(String *str)
String *Item_func_centroid::val_str(String *str)
{
String *wkb = args[0]->val_str(str);
String arg_val;
String *wkb = args[0]->val_str(&arg_val);
Geometry geom;
null_value = args[0]->null_value ||
......@@ -2522,7 +2526,8 @@ String *Item_func_centroid::val_str(String *str)
String *Item_func_spatial_decomp::val_str(String *str)
{
String *wkb = args[0]->val_str(str);
String arg_val;
String *wkb = args[0]->val_str(&arg_val);
Geometry geom;
if ((null_value = (args[0]->null_value ||
......@@ -2530,6 +2535,7 @@ String *Item_func_spatial_decomp::val_str(String *str)
return 0;
null_value=1;
str->length(0);
switch(decomp_func)
{
case SP_STARTPOINT:
......@@ -2559,7 +2565,8 @@ String *Item_func_spatial_decomp::val_str(String *str)
String *Item_func_spatial_decomp_n::val_str(String *str)
{
String *wkb = args[0]->val_str(str);
String arg_val;
String *wkb = args[0]->val_str(&arg_val);
long n = (long) args[1]->val_int();
Geometry geom;
......@@ -2639,6 +2646,7 @@ String *Item_func_point::val_str(String *str)
String *Item_func_spatial_collection::val_str(String *str)
{
String arg_value;
uint i;
null_value=1;
......@@ -2656,7 +2664,7 @@ String *Item_func_spatial_collection::val_str(String *str)
if (args[i]->null_value)
goto ret;
String *res = args[i]->val_str(str);
String *res = args[i]->val_str(&arg_value);
if ( coll_type == Geometry::wkbGeometryCollection )
{
......
......@@ -44,7 +44,7 @@ static Geometry::GClassInfo ci_collection[] =
IMPLEMENT_GEOM(GGeometryCollection, wkbGeometryCollection, "GEOMETRYCOLLECTION")
};
static Geometry::GClassInfo *ci_collection_end = ci_collection + sizeof(ci_collection);
static Geometry::GClassInfo *ci_collection_end = ci_collection + sizeof(ci_collection)/sizeof(ci_collection[0]);
/***************************** Geometry *******************************/
......@@ -66,7 +66,7 @@ Geometry::GClassInfo *Geometry::find_class(const char *name, size_t len)
cur_rt < ci_collection_end; ++cur_rt)
{
if ((cur_rt->m_name[len] == 0) &&
(strncmp(cur_rt->m_name, name, len) == 0))
(strncasecmp(cur_rt->m_name, name, len) == 0))
{
return cur_rt;
}
......
......@@ -225,7 +225,7 @@ class String
{
Ptr[str_length++] = c;
}
void q_append(const uint32 &n)
void q_append(const uint32 n)
{
int4store(Ptr + str_length, n);
str_length += 4;
......
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