mirror of
https://github.com/MariaDB/server.git
synced 2026-05-03 13:45:34 +02:00
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
This commit is contained in:
parent
22657f672c
commit
9a3fbf0d96
5 changed files with 25 additions and 17 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue