The enumeration Item::Type has data-type specific constants for literals:
This is not friendly to upcoming data type plugins, as they'll need to create their own literals.
We'll do the following:
- Remove the data type specific enumeration values from Item::Type
- Add a new value CONST_ITEM
- Fix the calling code to test for CONST_ITEM, and when it is necessary, detect the data type using other means, such as type_handler(), or by adding new virtual methods into Item or its descendants.
Note, under terms of this task, we'll preserve the old behavior. For example, Item_param::type() (when assigned to an integer value), reports itself as INT_ITEM. This makes parameter work as a position rather than an expression when used in ORDER BY:
This behavior was most likely introduced as a side effect. The new implementation will preserve the old behavior, including side effects like this.