diff options
author | unknown <hf@deer.(none)> | 2005-09-21 14:35:01 +0500 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2005-09-21 14:35:01 +0500 |
commit | 8fdef257ae94bfc0f82a1444aac1bd3e1a254c77 (patch) | |
tree | c65a5d5825d1a983b4726c069c6629a7381e3919 /sql/field.cc | |
parent | b51879f1695e9a98bfb898b7688bf7c28932ad8c (diff) | |
download | mariadb-git-8fdef257ae94bfc0f82a1444aac1bd3e1a254c77.tar.gz |
Fix for bug #12839 (Endian support is absurd)
mysql-test/r/gis.result:
test result fixed
mysql-test/t/gis.test:
test case added
sql/field.cc:
::construct calls added
sql/item_geofunc.cc:
::construct calls added
sql/spatial.cc:
Geometry_*::init_from_wkb implemented
sql/spatial.h:
init_from_wkb methods declared
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 9 |
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; |