after merge fix (bug #26038)

Item_func_geometry_from_text::val_str() should set null_value
in case of wrong data.


mysql-test/include/gis_generic.inc:
  after merge fix
  
  Item_func_geometry_from_text::val_str() should set null_value
  in case of wrong data.
mysql-test/r/archive_gis.result:
  after merge fix
  
  Item_func_geometry_from_text::val_str() should set null_value
  in case of wrong data.
mysql-test/r/gis.result:
  after merge fix
  
  Item_func_geometry_from_text::val_str() should set null_value
  in case of wrong data.
mysql-test/r/innodb_gis.result:
  after merge fix
  
  Item_func_geometry_from_text::val_str() should set null_value
  in case of wrong data.
mysql-test/r/ndb_gis.result:
  after merge fix
  
  Item_func_geometry_from_text::val_str() should set null_value
  in case of wrong data.
mysql-test/t/gis.test:
  after merge fix
  
  Item_func_geometry_from_text::val_str() should set null_value
  in case of wrong data.
sql/item_geofunc.cc:
  after merge fix
  
  Item_func_geometry_from_text::val_str() should set null_value
  in case of wrong data.
This commit is contained in:
unknown 2007-03-02 15:09:44 +04:00
commit d4272a16de
7 changed files with 60 additions and 21 deletions

View file

@ -64,11 +64,8 @@ String *Item_func_geometry_from_text::val_str(String *str)
return 0;
str->length(0);
str->q_append(srid);
if (!Geometry::create_from_wkt(&buffer, &trs, str, 0))
/* We shouldn't return NULL here as NULL is a legal spatial object */
/* Geometry::bad_spatial_data will produce error message beeing stored*/
/* in GEOMETRY field */
return &Geometry::bad_geometry_data;
if ((null_value= !Geometry::create_from_wkt(&buffer, &trs, str, 0)))
return 0;
return str;
}