Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
The enumeration Item::Type has data-type specific constants for literals:
- STRING_ITEM
- INT_ITEM
- REAL_ITEM
- DECIMAL_ITEM
- DATE_ITEM
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:
if (order_item->type() == Item::INT_ITEM && order_item->basic_const_item() && |
!from_window_spec)
|
This behavior was most likely introduced as a side effect. The new implementation will preserve the old behavior, including side effects like this.
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed
-
MDEV-15654 ADDTIME creates invalid timestamp value near DST changes
- Closed
- is blocked by
-
MDEV-15597 Add class Load_data_outvar and avoid using Item::STRING_ITEM for Item_user_var_as_out_param detection
- Closed
-
MDEV-15689 Fix Item_func_set_collation to pass the collation using CHARSET_INFO instead of Item
- Closed
-
MDEV-15702 Remove the use of STRING_ITEM from Item_func_date_format::fix_length_and_dec()
- Closed
-
MDEV-15714 Remove the use of STRING_ITEM from the parser
- Closed
-
MDEV-16309 Split ::create_tmp_field() into virtual methods in Item
- Closed
-
MDEV-16316 Replace INT_ITEM references in the code behind ORDER, LIMIT, PROCEDURE clause
- Closed
-
MDEV-16320 Replace INT_ITEM references in sql_select.cc
- Closed
-
MDEV-16379 Move Item_basic_const::used_table_map to Item_cache
- Closed
-
MDEV-16388 Replace member Item::fixed to virtual method is_fixed()
- Closed
-
MDEV-16408 Remove tests for Item::type() in Item_basic_value::eq()
- Closed