diff options
author | ramil/ram@mysql.com/ramil.myoffice.izhnet.ru <> | 2007-03-05 18:22:35 +0400 |
---|---|---|
committer | ramil/ram@mysql.com/ramil.myoffice.izhnet.ru <> | 2007-03-05 18:22:35 +0400 |
commit | fe801fcf5db2f1aadcfa151e66f7e2105e8310d4 (patch) | |
tree | e8e2e1eb2f14e501eebbc3b53f140a1fd251f97e /sql/spatial.cc | |
parent | c53433f307d69c1b87d9340ff6a2e9938b436cad (diff) | |
parent | f165316cfcaf52875d56fdf99404c1cf483cb05d (diff) | |
download | mariadb-git-fe801fcf5db2f1aadcfa151e66f7e2105e8310d4.tar.gz |
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into mysql.com:/home/ram/work/b26038/b26038.5.0
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 bd4b6278eab..939e7d2a3b4 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; } |