1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-12078 Using spatial index changes type from point to geometry

In get_mm_tree we have to change Field_geom::geom_type to
        GEOMETRY as we have to let storing all types of the spatial features
        in the field. So now we restore the original geom_type as it's
        done.
This commit is contained in:
Alexey Botchkov
2017-03-14 16:35:39 +04:00
parent 6b99859fff
commit a06f2f430f
3 changed files with 53 additions and 0 deletions

View File

@ -7949,8 +7949,10 @@ static SEL_TREE *get_full_func_mm_tree(RANGE_OPT_PARAM *param,
DBUG_ENTER("get_full_func_mm_tree");
#ifdef HAVE_SPATIAL
Field::geometry_type sav_geom_type;
if (field_item->field->type() == MYSQL_TYPE_GEOMETRY)
{
sav_geom_type= ((Field_geom*) field_item->field)->geom_type;
/* We have to be able to store all sorts of spatial features here */
((Field_geom*) field_item->field)->geom_type= Field::GEOM_GEOMETRY;
}
@ -7982,6 +7984,13 @@ static SEL_TREE *get_full_func_mm_tree(RANGE_OPT_PARAM *param,
}
}
}
#ifdef HAVE_SPATIAL
if (field_item->field->type() == MYSQL_TYPE_GEOMETRY)
{
((Field_geom*) field_item->field)->geom_type= sav_geom_type;
}
#endif /*HAVE_SPATIAL*/
DBUG_RETURN(ftree);
}