Commit b21dc119 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-21389 Derive Item_func_month from Item_long_func

parent 59a08874
......@@ -170,28 +170,13 @@ class Item_func_dayofmonth :public Item_long_func_date_field
};
class Item_func_month :public Item_func
class Item_func_month :public Item_long_func
{
public:
Item_func_month(THD *thd, Item *a): Item_func(thd, a)
{ collation.set_numeric(); }
Item_func_month(THD *thd, Item *a): Item_long_func(thd, a)
{ }
longlong val_int();
double val_real()
{ DBUG_ASSERT(fixed == 1); return (double) Item_func_month::val_int(); }
String *val_str(String *str)
{
longlong nr= val_int();
if (null_value)
return 0;
str->set(nr, collation.collation);
return str;
}
bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
return get_date_from_int(ltime, fuzzydate);
}
const char *func_name() const { return "month"; }
const Type_handler *type_handler() const { return &type_handler_long; }
bool fix_length_and_dec()
{
decimals= 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment