diff options
author | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-02-28 12:13:46 +0400 |
---|---|---|
committer | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-02-28 12:13:46 +0400 |
commit | a32e19c7881f424b69cdd4751f8be9318fa4c98a (patch) | |
tree | 512ba10b1044d921271065de17ad13876346eb22 /sql/spatial.cc | |
parent | 3c5f2700dd716329b61c26f8dc6b3958d13e59d2 (diff) | |
parent | 6c5a3c240a8f137f39fe8915fc5d4dd57d7688d9 (diff) | |
download | mariadb-git-a32e19c7881f424b69cdd4751f8be9318fa4c98a.tar.gz |
Merge mysql.com:/home/ram/work/b26038/b26038.4.1
into mysql.com:/home/ram/work/b26038/b26038.5.0
sql/item_geofunc.cc:
Auto merged
sql/spatial.cc:
Auto merged
sql/spatial.h:
Auto merged
mysql-test/r/gis.result:
will be fixed after the merging.
mysql-test/t/gis.test:
merging, the result will be fixed in an after-merge fix CS
sql/item_geofunc.h:
merging
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r-- | sql/spatial.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc index 9012ced1041..abb97a71e0c 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -213,23 +213,24 @@ static uint32 wkb_get_uint(const char *ptr, Geometry::wkbByteOrder bo) } -int Geometry::create_from_wkb(Geometry_buffer *buffer, - const char *wkb, uint32 len, String *res) +Geometry *Geometry::create_from_wkb(Geometry_buffer *buffer, + const char *wkb, uint32 len, String *res) { uint32 geom_type; Geometry *geom; if (len < WKB_HEADER_SIZE) - return 1; + return NULL; geom_type= wkb_get_uint(wkb+1, (wkbByteOrder)wkb[0]); if (!(geom= create_by_typeid(buffer, (int) geom_type)) || res->reserve(WKB_HEADER_SIZE, 512)) - return 1; + return NULL; res->q_append((char) wkb_ndr); res->q_append(geom_type); - return geom->init_from_wkb(wkb+WKB_HEADER_SIZE, len - WKB_HEADER_SIZE, - (wkbByteOrder) wkb[0], res); + + return geom->init_from_wkb(wkb + WKB_HEADER_SIZE, len - WKB_HEADER_SIZE, + (wkbByteOrder) wkb[0], res) ? geom : NULL; } |