The code in Item_bool_func::get_mm_leaf() and stored_field_cmp_to_item() has tests for Field::type_handler(), Field::cmp_type(), Field::type().
This is not friendly to pluggable data types.
Under terms of this task we'll split the code into new virtual methods with approximately these prototypes:
and move data-type specific pieces of Item_bool_func::get_mm_leaf() and stored_field_cmp_to_item() into virtual implementations of the new methods.
With this approach, pluggable data types will be able to implement their own methods to control the range optimizer