Fix GCC 10.2.0 -Og -Wmaybe-uninitialized

This commit is contained in:
Marko Mäkelä 2020-08-31 16:48:28 +03:00
parent 97db6c15ea
commit 4a165f3711

View file

@ -7555,13 +7555,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*/
@ -7592,9 +7594,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);