summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 6d2f92e27ea..ccf82bdbae3 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -5745,8 +5745,8 @@ void Field_blob::get_key_image(char *buff,uint length,
return;
}
get_ptr(&blob);
- gobj= Geometry::create_from_wkb(&buffer,
- blob + SRID_SIZE, blob_length - SRID_SIZE);
+ gobj= Geometry::construct(&buffer,
+ blob + SRID_SIZE, blob_length - SRID_SIZE);
if (gobj->get_mbr(&mbr, &dummy))
bzero(buff, SIZEOF_STORED_DOUBLE*4);
else
@@ -6039,8 +6039,7 @@ void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs,
return;
}
get_ptr(&blob);
- gobj= Geometry::create_from_wkb(&buffer,
- blob + SRID_SIZE, blob_length - SRID_SIZE);
+ gobj= Geometry::construct(&buffer, blob, blob_length);
if (gobj->get_mbr(&mbr, &dummy))
bzero(buff, SIZEOF_STORED_DOUBLE*4);
else
@@ -6100,7 +6099,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
uint32 wkb_type;
if (length < SRID_SIZE + WKB_HEADER_SIZE + SIZEOF_STORED_DOUBLE*2)
goto err;
- wkb_type= uint4korr(from + WKB_HEADER_SIZE);
+ wkb_type= uint4korr(from + SRID_SIZE + 1);
if (wkb_type < (uint32) Geometry::wkb_point ||
wkb_type > (uint32) Geometry::wkb_end)
return -1;