diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-09-03 09:26:54 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-09-03 09:26:54 +0300 |
commit | c3752cef3c34589ea95a7ab66cff3dd5b11290d5 (patch) | |
tree | c7b8eb21dedd3139dacf2c0a12bed6e362afa1d9 /sql/opt_range.cc | |
parent | 56ae0adee35c1bc053711a8579857e6b0301eb80 (diff) | |
parent | 2a93e632b1676b6df3dde150888d6428a57f8399 (diff) | |
download | mariadb-git-c3752cef3c34589ea95a7ab66cff3dd5b11290d5.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 0edc1665ac9..a00e0ebdfb0 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7583,13 +7583,15 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param, table_map param_comp= ~(param->prev_tables | param->read_tables | param->current_table); #ifdef HAVE_SPATIAL - Field::geometry_type sav_geom_type; - const bool geometry= field_item->field->type() == MYSQL_TYPE_GEOMETRY; - if (geometry) + Field::geometry_type sav_geom_type= Field::GEOM_GEOMETRY, *geom_type= + field_item->field->type() == MYSQL_TYPE_GEOMETRY + ? &(static_cast<Field_geom*>(field_item->field))->geom_type + : NULL; + if (geom_type) { - sav_geom_type= ((Field_geom*) field_item->field)->geom_type; + sav_geom_type= *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; + *geom_type= Field::GEOM_GEOMETRY; } #endif /*HAVE_SPATIAL*/ @@ -7620,9 +7622,9 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param, } #ifdef HAVE_SPATIAL - if (geometry) + if (geom_type) { - ((Field_geom*) field_item->field)->geom_type= sav_geom_type; + *geom_type= sav_geom_type; } #endif /*HAVE_SPATIAL*/ DBUG_RETURN(ftree); |