summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-10-10 16:26:02 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-10-10 16:26:02 +0300
commitaec287fd670e7ee51c4ab7dfcd1b18da96ff3dea (patch)
tree10232e94f6ae12c66b7122e5c199c8de76b8add1 /sql/field.cc
parent6146c0c75d013b15ea2c6656ee0d774498734fd2 (diff)
downloadmariadb-git-aec287fd670e7ee51c4ab7dfcd1b18da96ff3dea.tar.gz
Bug #30825: Problems when putting a non-spatial index on a GIS column
Fixed the usage of spatial data (and Point in specific) with non-spatial indexes. Several problems : - The length of the Point class was not updated to include the spatial reference system identifier. Fixed by increasing with 4 bytes. - The storage length of the spatial columns was not accounting for the length that is prepended to it. Fixed by treating the spatial data columns as blobs (and thus increasing the storage length) - When creating the key image for comparison in index read wrong key image was created (the one needed for and r-tree search, not the one for b-tree/other search). Fixed by treating the spatial data columns as blobs (and creating the correct kind of image based on the index type). mysql-test/r/bdb_gis.result: Bug #30825: bdb tests mysql-test/r/gis-rtree.result: Bug #30825: key length changed mysql-test/r/gis.result: Bug #30825: MyISAM tests mysql-test/r/innodb_gis.result: Bug #30825: InnoDB tests mysql-test/t/bdb_gis.test: Bug #30825: bdb tests mysql-test/t/gis.test: Bug #30825: MyISAM tests mysql-test/t/innodb_gis.test: Bug #30825: InnoDB tests sql/field.cc: Bug #30825: Removed Field_geom::get_key_image as Field_blog::get_key_image takes type parameter into consideration and is a superset of Field_geom::get_key_image() sql/field.h: Bug #30825: Removed Field_geom::get_key_image as Field_blog::get_key_image takes type parameter into consideration and is a superset of Field_geom::get_key_image() sql/sql_select.h: Bug #30825: Geometry data are a blob derivate sql/sql_table.cc: Bug #30825: Increased key length to accomodate for spatial reference system identifier (srid) sql/sql_yacc.yy: Bug #30825: Increased key length to accomodate for spatial reference system identifier (srid) sql/table.cc: Bug #30825: It stores a length for spatial data as well, so increase the storage length (as it's done for blobs). mysql-test/include/gis_keys.inc: Bug #30825: Test file for spatial data and non-spatial indexes
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc30
1 files changed, 0 insertions, 30 deletions
diff --git a/sql/field.cc b/sql/field.cc
index e6e4195ba1e..ded31972a7f 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -7416,36 +7416,6 @@ uint Field_blob::max_packed_col_length(uint max_length)
#ifdef HAVE_SPATIAL
-uint Field_geom::get_key_image(char *buff, uint length, imagetype type)
-{
- char *blob;
- const char *dummy;
- MBR mbr;
- ulong blob_length= get_length(ptr);
- Geometry_buffer buffer;
- Geometry *gobj;
- const uint image_length= SIZEOF_STORED_DOUBLE*4;
-
- if (blob_length < SRID_SIZE)
- {
- bzero(buff, image_length);
- return image_length;
- }
- get_ptr(&blob);
- gobj= Geometry::construct(&buffer, blob, blob_length);
- if (!gobj || gobj->get_mbr(&mbr, &dummy))
- bzero(buff, image_length);
- else
- {
- float8store(buff, mbr.xmin);
- float8store(buff + 8, mbr.xmax);
- float8store(buff + 16, mbr.ymin);
- float8store(buff + 24, mbr.ymax);
- }
- return image_length;
-}
-
-
void Field_geom::sql_type(String &res) const
{
CHARSET_INFO *cs= &my_charset_latin1;