Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
Item_bool_func::get_full_func_mm_tree() has the following code blocks:
#ifdef HAVE_SPATIAL
|
const Type_handler_geometry *sav_geom_type= NULL; |
Field_geom *field_geom= dynamic_cast<Field_geom*>(field_item->field); |
if (field_geom) |
{
|
sav_geom_type= field_geom->type_handler_geom();
|
/* We have to be able to store all sorts of spatial features here */ |
field_geom->set_type_handler(&type_handler_geometry);
|
}
|
#endif /*HAVE_SPATIAL*/ |
and
#ifdef HAVE_SPATIAL
|
if (field_geom) |
{
|
DBUG_ASSERT(sav_geom_type);
|
field_geom->set_type_handler(sav_geom_type);
|
}
|
#endif /*HAVE_SPATIAL*/ |
This code here prevents moving GIS implementation into a data type plugin. The server code should at the end know nothing about Field_geom and type_handler_geometry.
Let's move this code inside Item_func_spatial_rel::get_mm_leaf(), so the Field_geom's type handler is changed just before the call for save_in_field_no_warnings() and restore it immediately after this.
The new code in Item_func_spatial_rel::get_mm_leaf() will look like this:
Field_geom *field_geom= dynamic_cast<Field_geom*>(field); |
DBUG_ASSERT(field_geom);
|
const Type_handler_geometry *sav_geom_type= field_geom->type_handler_geom(); |
// We have to be able to store all sorts of spatial features here |
field_geom->set_type_handler(&type_handler_geometry);
|
bool rc= value->save_in_field_no_warnings(field, 1); |
field_geom->set_type_handler(sav_geom_type);
|
if (rc) |
DBUG_RETURN(&sel_arg_impossible);
|
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed