diff options
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r-- | sql/spatial.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc index 9012ced1041..22df69a978b 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -33,8 +33,11 @@ static Geometry::Class_info **ci_collection_end= Geometry::Class_info::Class_info(const char *name, int type_id, void(*create_func)(void *)): - m_name(name, strlen(name)), m_type_id(type_id), m_create_func(create_func) + m_type_id(type_id), m_create_func(create_func) { + m_name.str= (char *) name; + m_name.length= strlen(name); + ci_collection[type_id]= this; } @@ -825,7 +828,6 @@ int Gis_polygon::area(double *ar, const char **end_of_data) const double x, y; get_point(&x, &y, data); data+= (SIZEOF_STORED_DOUBLE*2); - /* QQ: Is the following prev_x+x right ? */ lr_area+= (prev_x + x)* (prev_y - y); prev_x= x; prev_y= y; @@ -948,7 +950,6 @@ int Gis_polygon::centroid_xy(double *x, double *y) const double x, y; get_point(&x, &y, data); data+= (SIZEOF_STORED_DOUBLE*2); - /* QQ: Is the following prev_x+x right ? */ cur_area+= (prev_x + x) * (prev_y - y); cur_cx+= x; cur_cy+= y; |