File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -7555,13 +7555,15 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param,
75557555 table_map param_comp= ~(param->prev_tables | param->read_tables |
75567556 param->current_table );
75577557#ifdef HAVE_SPATIAL
7558- Field::geometry_type sav_geom_type;
7559- const bool geometry= field_item->field ->type () == MYSQL_TYPE_GEOMETRY;
7560- if (geometry)
7558+ Field::geometry_type sav_geom_type= Field::GEOM_GEOMETRY, *geom_type=
7559+ field_item->field ->type () == MYSQL_TYPE_GEOMETRY
7560+ ? &(static_cast <Field_geom*>(field_item->field ))->geom_type
7561+ : NULL ;
7562+ if (geom_type)
75617563 {
7562- sav_geom_type= ((Field_geom*) field_item-> field )-> geom_type ;
7564+ sav_geom_type= * geom_type;
75637565 /* We have to be able to store all sorts of spatial features here */
7564- ((Field_geom*) field_item-> field )-> geom_type = Field::GEOM_GEOMETRY;
7566+ * geom_type= Field::GEOM_GEOMETRY;
75657567 }
75667568#endif /* HAVE_SPATIAL*/
75677569
@@ -7592,9 +7594,9 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param,
75927594 }
75937595
75947596#ifdef HAVE_SPATIAL
7595- if (geometry )
7597+ if (geom_type )
75967598 {
7597- ((Field_geom*) field_item-> field )-> geom_type = sav_geom_type;
7599+ * geom_type= sav_geom_type;
75987600 }
75997601#endif /* HAVE_SPATIAL*/
76007602 DBUG_RETURN (ftree);
You can’t perform that action at this time.
0 commit comments