Loading sql/item_timefunc.h +8 −11 Original line number Diff line number Diff line Loading @@ -351,7 +351,7 @@ class Item_date :public Item_func enum_field_types field_type() const { return MYSQL_TYPE_DATE; } String *val_str(String *str); longlong val_int(); double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); } double val_real() { return val_real_from_decimal(); } const char *func_name() const { return "date"; } void fix_length_and_dec() { Loading Loading @@ -389,6 +389,7 @@ class Item_date_func :public Item_str_func return tmp_table_field_from_field_type(table, 0); } bool result_as_longlong() { return TRUE; } double val_real() { return (double) val_int(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); Loading @@ -411,13 +412,14 @@ class Item_str_timefunc :public Item_str_func enum_field_types field_type() const { return MYSQL_TYPE_TIME; } void fix_length_and_dec() { decimals=0; decimals= DATETIME_DEC; max_length=MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; } Field *tmp_table_field(TABLE *table) { return tmp_table_field_from_field_type(table, 0); } double val_real() { return val_real_from_decimal(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); Loading Loading @@ -521,7 +523,6 @@ class Item_func_now :public Item_date_func Item_func_now() :Item_date_func() {} Item_func_now(Item *a) :Item_date_func(a) {} enum Item_result result_type () const { return STRING_RESULT; } double val_real() { DBUG_ASSERT(fixed == 1); return (double) value; } longlong val_int() { DBUG_ASSERT(fixed == 1); return value; } int save_in_field(Field *to, bool no_conversions); String *val_str(String *str); Loading Loading @@ -611,11 +612,6 @@ class Item_func_from_unixtime :public Item_date_func THD *thd; public: Item_func_from_unixtime(Item *a) :Item_date_func(a) {} double val_real() { DBUG_ASSERT(fixed == 1); return (double) Item_func_from_unixtime::val_int(); } longlong val_int(); String *val_str(String *str); const char *func_name() const { return "from_unixtime"; } Loading Loading @@ -653,7 +649,6 @@ class Item_func_convert_tz :public Item_date_func Item_func_convert_tz(Item *a, Item *b, Item *c): Item_date_func(a, b, c), from_tz_cached(0), to_tz_cached(0) {} longlong val_int(); double val_real() { return (double) val_int(); } String *val_str(String *str); const char *func_name() const { return "convert_tz"; } void fix_length_and_dec(); Loading @@ -678,7 +673,6 @@ class Item_func_sec_to_time :public Item_str_timefunc Item_str_timefunc::fix_length_and_dec(); collation.set(&my_charset_bin); maybe_null=1; decimals= DATETIME_DEC; } const char *func_name() const { return "sec_to_time"; } bool result_as_longlong() { return TRUE; } Loading @@ -700,7 +694,6 @@ class Item_date_add_interval :public Item_date_func const char *func_name() const { return "date_add_interval"; } void fix_length_and_dec(); enum_field_types field_type() const { return cached_field_type; } double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); } longlong val_int(); bool get_date(TIME *res, uint fuzzy_date); bool eq(const Item *item, bool binary_cmp) const; Loading Loading @@ -805,6 +798,7 @@ class Item_date_typecast :public Item_typecast_maybe_null } bool result_as_longlong() { return TRUE; } longlong val_int(); double val_real() { return (double) val_int(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); Loading Loading @@ -832,6 +826,7 @@ class Item_time_typecast :public Item_typecast_maybe_null } bool result_as_longlong() { return TRUE; } longlong val_int(); double val_real() { return val_real_from_decimal(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); Loading Loading @@ -863,6 +858,7 @@ class Item_datetime_typecast :public Item_typecast_maybe_null } bool result_as_longlong() { return TRUE; } longlong val_int(); double val_real() { return val_real_from_decimal(); } double val() { return (double) val_int(); } my_decimal *val_decimal(my_decimal *decimal_value) { Loading Loading @@ -912,6 +908,7 @@ class Item_func_add_time :public Item_str_func void print(String *str); const char *func_name() const { return "add_time"; } bool check_partition_func_processor(byte *int_arg) {return FALSE;} double val_real() { return val_real_from_decimal(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); Loading Loading
sql/item_timefunc.h +8 −11 Original line number Diff line number Diff line Loading @@ -351,7 +351,7 @@ class Item_date :public Item_func enum_field_types field_type() const { return MYSQL_TYPE_DATE; } String *val_str(String *str); longlong val_int(); double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); } double val_real() { return val_real_from_decimal(); } const char *func_name() const { return "date"; } void fix_length_and_dec() { Loading Loading @@ -389,6 +389,7 @@ class Item_date_func :public Item_str_func return tmp_table_field_from_field_type(table, 0); } bool result_as_longlong() { return TRUE; } double val_real() { return (double) val_int(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); Loading @@ -411,13 +412,14 @@ class Item_str_timefunc :public Item_str_func enum_field_types field_type() const { return MYSQL_TYPE_TIME; } void fix_length_and_dec() { decimals=0; decimals= DATETIME_DEC; max_length=MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; } Field *tmp_table_field(TABLE *table) { return tmp_table_field_from_field_type(table, 0); } double val_real() { return val_real_from_decimal(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); Loading Loading @@ -521,7 +523,6 @@ class Item_func_now :public Item_date_func Item_func_now() :Item_date_func() {} Item_func_now(Item *a) :Item_date_func(a) {} enum Item_result result_type () const { return STRING_RESULT; } double val_real() { DBUG_ASSERT(fixed == 1); return (double) value; } longlong val_int() { DBUG_ASSERT(fixed == 1); return value; } int save_in_field(Field *to, bool no_conversions); String *val_str(String *str); Loading Loading @@ -611,11 +612,6 @@ class Item_func_from_unixtime :public Item_date_func THD *thd; public: Item_func_from_unixtime(Item *a) :Item_date_func(a) {} double val_real() { DBUG_ASSERT(fixed == 1); return (double) Item_func_from_unixtime::val_int(); } longlong val_int(); String *val_str(String *str); const char *func_name() const { return "from_unixtime"; } Loading Loading @@ -653,7 +649,6 @@ class Item_func_convert_tz :public Item_date_func Item_func_convert_tz(Item *a, Item *b, Item *c): Item_date_func(a, b, c), from_tz_cached(0), to_tz_cached(0) {} longlong val_int(); double val_real() { return (double) val_int(); } String *val_str(String *str); const char *func_name() const { return "convert_tz"; } void fix_length_and_dec(); Loading @@ -678,7 +673,6 @@ class Item_func_sec_to_time :public Item_str_timefunc Item_str_timefunc::fix_length_and_dec(); collation.set(&my_charset_bin); maybe_null=1; decimals= DATETIME_DEC; } const char *func_name() const { return "sec_to_time"; } bool result_as_longlong() { return TRUE; } Loading @@ -700,7 +694,6 @@ class Item_date_add_interval :public Item_date_func const char *func_name() const { return "date_add_interval"; } void fix_length_and_dec(); enum_field_types field_type() const { return cached_field_type; } double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); } longlong val_int(); bool get_date(TIME *res, uint fuzzy_date); bool eq(const Item *item, bool binary_cmp) const; Loading Loading @@ -805,6 +798,7 @@ class Item_date_typecast :public Item_typecast_maybe_null } bool result_as_longlong() { return TRUE; } longlong val_int(); double val_real() { return (double) val_int(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); Loading Loading @@ -832,6 +826,7 @@ class Item_time_typecast :public Item_typecast_maybe_null } bool result_as_longlong() { return TRUE; } longlong val_int(); double val_real() { return val_real_from_decimal(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); Loading Loading @@ -863,6 +858,7 @@ class Item_datetime_typecast :public Item_typecast_maybe_null } bool result_as_longlong() { return TRUE; } longlong val_int(); double val_real() { return val_real_from_decimal(); } double val() { return (double) val_int(); } my_decimal *val_decimal(my_decimal *decimal_value) { Loading Loading @@ -912,6 +908,7 @@ class Item_func_add_time :public Item_str_func void print(String *str); const char *func_name() const { return "add_time"; } bool check_partition_func_processor(byte *int_arg) {return FALSE;} double val_real() { return val_real_from_decimal(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); Loading