Commit 8da6f729 authored by hf@deer.mysql.r18.ru's avatar hf@deer.mysql.r18.ru

Merge abotchkov@work.mysql.com:/home/bk/mysql-4.1

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