diff options
author | unknown <hf@deer.(none)> | 2004-03-15 16:32:53 +0400 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2004-03-15 16:32:53 +0400 |
commit | 9a3fbf0d96426dd5273bb8992c4b131965e6d1e1 (patch) | |
tree | 2cab975faaba9bbd5292393c6b415c5159079213 /sql/item_geofunc.cc | |
parent | 22657f672c8d4c005f85cd3efc714d98b635f3f0 (diff) | |
download | mariadb-git-9a3fbf0d96426dd5273bb8992c4b131965e6d1e1.tar.gz |
Fix for valgrind's warning
sql/gstream.cc:
checking for ending \0 changed with m_limit
sql/gstream.h:
checking for ending \0 changed with m_limit
sql/item_geofunc.cc:
we should check for null value before we use val_str result
sql/item_strfunc.cc:
get rid of annoying warnings
sql/spatial.h:
error about size_t type fixed
Diffstat (limited to 'sql/item_geofunc.cc')
-rw-r--r-- | sql/item_geofunc.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 02c0f5829fd..1c9338f5f35 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -31,10 +31,13 @@ String *Item_func_geometry_from_text::val_str(String *str) { Geometry_buffer buffer; - Geometry *geom; String arg_val; String *wkt= args[0]->val_str(&arg_val); - Gis_read_stream trs(wkt->c_ptr(), wkt->length()); + + if ((null_value= args[0]->null_value)) + return 0; + + Gis_read_stream trs(wkt->charset(), wkt->ptr(), wkt->length()); uint32 srid= 0; if ((arg_count == 2) && !args[1]->null_value) @@ -44,8 +47,7 @@ String *Item_func_geometry_from_text::val_str(String *str) return 0; str->length(0); str->q_append(srid); - if ((null_value=(args[0]->null_value || - !(geom= Geometry::create_from_wkt(&buffer, &trs, str, 0))))) + if ((null_value= !Geometry::create_from_wkt(&buffer, &trs, str, 0))) return 0; return str; } |