From f165316cfcaf52875d56fdf99404c1cf483cb05d Mon Sep 17 00:00:00 2001 From: "ramil/ram@mysql.com/ramil.myoffice.izhnet.ru" <> Date: Fri, 2 Mar 2007 15:09:44 +0400 Subject: after merge fix (bug #26038) Item_func_geometry_from_text::val_str() should set null_value in case of wrong data. --- sql/item_geofunc.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sql') diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 955ba0ef67a..11cb8ad935b 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -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; } -- cgit v1.2.1