1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

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
This commit is contained in:
unknown
2007-03-05 17:12:37 +04:00
10 changed files with 153 additions and 47 deletions

View File

@@ -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;
}