summaryrefslogtreecommitdiff
path: root/sql/spatial.cc
diff options
context:
space:
mode:
authorunknown <ramil/ram@ramil.myoffice.izhnet.ru>2007-03-05 17:12:37 +0400
committerunknown <ramil/ram@ramil.myoffice.izhnet.ru>2007-03-05 17:12:37 +0400
commit57c08a6a3355faa28ab243281e8aca86f1e7b46c (patch)
tree4e122dc2fcc68efa8a2682f9282622f6e00664a8 /sql/spatial.cc
parent71a25f2b3e07abd83affc63c485fb69366fa369a (diff)
parentd4272a16deb9aa1b2428e446b2321697aebf9d94 (diff)
downloadmariadb-git-57c08a6a3355faa28ab243281e8aca86f1e7b46c.tar.gz
Merge mysql.com:/home/ram/work/b26038/b26038.5.0
into mysql.com:/home/ram/work/b26038/b26038.5.1 mysql-test/t/gis.test: Auto merged sql/item_geofunc.cc: Auto merged sql/item_geofunc.h: Auto merged sql/spatial.cc: Auto merged sql/spatial.h: Auto merged mysql-test/include/gis_generic.inc: manual merge mysql-test/r/archive_gis.result: manual merge mysql-test/r/gis.result: manual merge mysql-test/r/innodb_gis.result: manual merge mysql-test/r/ndb_gis.result: manual merge
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r--sql/spatial.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 6cadb0f3aad..e0680ed182c 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -216,23 +216,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;
}