diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2017-03-14 16:35:39 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2017-07-11 23:27:19 +0400 |
commit | a06f2f430f6cfd55929c3734b24e04fa70803156 (patch) | |
tree | a23f9e5f08226fd9d147d5ee54e06ecf975f7841 /sql | |
parent | 6b99859fff6b8c0a52ea45965834c9c3fdfc4cb3 (diff) | |
download | mariadb-git-a06f2f430f6cfd55929c3734b24e04fa70803156.tar.gz |
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.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/opt_range.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 481d8445fa8..3563058282b 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -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); } |