Some data types have extended attrubutes:
- ENUM/SET have TYPELIB
- GEOMETRY has geometry type and SRID
These data types are handled in a very different way all around the code.
This task will introduce new classes:
- Type_ext_attributes (a child of Type_typelib_attributes and Type_geom_attributes)
and a new method in Type_handler with this prototype:
The intent is to handle extended data type attributes in a unified way, and remove a few tests for field_type() against MYSQL_TYPE_GEOMETRY, MYSQL_TYPE_SET, MYSQL_TYPE_ENUM.
The new class Type_ext_attributes will be reused in classes Column_definition, Item_hybrid_func and Item_type_holder, instead of declaring ENUM and GEOMETRY related attributes in every class separately. So these class definitions will change to:
This means that Column_definition::interval will be renamed to Column_definition::typelib. This will cause changes in a few dozen of lines. But this is OK. We'll eventually have the INTERVAL data type (as in the SQL Standard), so the old name would be confusing. The new name is better.
Also, this means that Item_type_holder::enum_set_typelib will be renamed to Item_type_holder::typelib. But this will cause changes only in a few lines.
Note, the new class Type_ext_attributes will be used in a few field creation methods in Type_handler later.