Fix for bug #6117 (Centroid() crashes server)

I learned that one shouldn't use String::set in val_str() methods...


mysql-test/r/gis.result:
  Test result for #6117
mysql-test/t/gis.test:
  Test case #6117
sql/item_geofunc.cc:
  String::set doesn't work here
sql/spatial.cc:
  Error message isn't needed here
This commit is contained in:
unknown 2004-10-22 20:32:02 +05:00
commit 7e38104cb4
4 changed files with 153 additions and 6 deletions

View file

@ -148,9 +148,9 @@ String *Item_func_geometry_type::val_str(String *str)
swkb->length() - SRID_SIZE)))))
return 0;
/* String will not move */
str->set(geom->get_class_info()->m_name.str,
geom->get_class_info()->m_name.length,
default_charset());
str->copy(geom->get_class_info()->m_name.str,
geom->get_class_info()->m_name.length,
default_charset());
return str;
}