diff options
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc index 38f5ed6bf5c..5bc9d5816eb 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -8921,6 +8921,18 @@ Item_cache_temporal::Item_cache_temporal(enum_field_types field_type_arg): } +longlong Item_cache_temporal::val_temporal_packed() +{ + DBUG_ASSERT(fixed == 1); + if ((!value_cached && !cache_value()) || null_value) + { + null_value= TRUE; + return 0; + } + return value; +} + + String *Item_cache_temporal::val_str(String *str) { DBUG_ASSERT(fixed == 1); @@ -8933,6 +8945,42 @@ String *Item_cache_temporal::val_str(String *str) } +my_decimal *Item_cache_temporal::val_decimal(my_decimal *decimal_value) +{ + DBUG_ASSERT(fixed == 1); + if ((!value_cached && !cache_value()) || null_value) + { + null_value= true; + return NULL; + } + return val_decimal_from_date(decimal_value); +} + + +longlong Item_cache_temporal::val_int() +{ + DBUG_ASSERT(fixed == 1); + if ((!value_cached && !cache_value()) || null_value) + { + null_value= true; + return 0; + } + return val_int_from_date(); +} + + +double Item_cache_temporal::val_real() +{ + DBUG_ASSERT(fixed == 1); + if ((!value_cached && !cache_value()) || null_value) + { + null_value= true; + return 0; + } + return val_real_from_date(); +} + + bool Item_cache_temporal::cache_value() { if (!example) |