Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
Item_cache_temporal has the following methods with tests for field_type():
longlong Item_cache_temporal::val_datetime_packed()
|
{
|
if (Item_cache_temporal::field_type() == MYSQL_TYPE_TIME) |
return Item::val_datetime_packed(); // TIME-to-DATETIME conversion needed |
if ((!value_cached && !cache_value()) || null_value) |
{
|
null_value= TRUE;
|
return 0; |
}
|
return value; |
}
|
longlong Item_cache_temporal::val_time_packed()
|
{
|
if (Item_cache_temporal::field_type() != MYSQL_TYPE_TIME) |
return Item::val_time_packed(); // DATETIME-to-TIME conversion needed |
if ((!value_cached && !cache_value()) || null_value) |
{
|
null_value= TRUE;
|
return 0; |
}
|
return value; |
}
|
Tests for field_type() are not friendly for user defined data types (plugins) and should all be eventually gone.
Under terms of this task we'll move implementations of val_datetime_packed() and val_time_packed() from Item_cache_temporal to its descendants:
- Item_cache_date
- Item_cache_time
- Item_catche_datetime
and thus remove the need to test field_type().
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed