1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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).
This commit is contained in:
gkodinov/kgeorge@magare.gmz
2007-10-10 16:26:02 +03:00
parent 20ec6605d3
commit e971b18f06
14 changed files with 181 additions and 39 deletions

View File

@ -521,9 +521,13 @@ public:
store_key(THD *thd, Field *field_arg, char *ptr, char *null, uint length)
:null_key(0), null_ptr(null), err(0)
{
if (field_arg->type() == FIELD_TYPE_BLOB)
if (field_arg->type() == FIELD_TYPE_BLOB
|| field_arg->type() == FIELD_TYPE_GEOMETRY)
{
/* Key segments are always packed with a 2 byte length prefix */
/*
Key segments are always packed with a 2 byte length prefix.
See mi_rkey for details.
*/
to_field=new Field_varstring(ptr, length, 2, (uchar*) null, 1,
Field::NONE, field_arg->field_name,
field_arg->table, field_arg->charset());