• evgen@moonbone.local's avatar
    Bug#28763: Selecting geometry fields in UNION caused server crash. · eb9e174b
    evgen@moonbone.local authored
    This bug was introduced by the fix for the bug#27300. In this fix a section
    of code was added to the Item::tmp_table_field_from_field_type method.
    This section intended to create Field_geom fields for the Item_geometry_func
    class and its descendants. In order to get the geometry type of the current
    item it casted "this" to the Item_geometry_func* type. But the
    Item::tmp_table_field_from_field_type method is also used for creation of
    fields for UNION and in this case this method is called for an object of the
    Item_type_holder class and the cast to the Item_geometry_func* type causes 
    a server crash.
    
    Now the Item::tmp_table_field_from_field_type method correctly works when it's
    called for both the Item_type_holder and the Item_geometry_func classes.
    The new geometry_type variable is added to the Item_type_holder class.
    The new method called get_geometry_type is added to the Item_field
    and the Field classes. It returns geometry type from the field for the
    Item_field and the Field_geom classes and fails an assert for other Field
    descendants.
    eb9e174b
item.h 82.5 KB