23 #include <drizzled/error.h>
24 #include <drizzled/session.h>
25 #include <drizzled/function/time/month.h>
26 #include <drizzled/typelib.h>
27 #include <drizzled/system_variables.h>
44 Item_result arg0_result_type= args[0]->result_type();
46 switch (arg0_result_type)
59 char buff[DRIZZLE_MAX_LENGTH_DATETIME_AS_STRING];
60 String tmp(buff,
sizeof(buff), &my_charset_utf8_bin);
63 if (res && (res != &tmp))
68 if (! temporal.
from_string(tmp.c_ptr(), tmp.length()))
74 my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
90 char buff[DRIZZLE_MAX_LENGTH_DATETIME_AS_STRING];
91 String tmp(buff,
sizeof(buff), &my_charset_utf8_bin);
96 if (res && (res != &tmp))
101 my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
105 return (int64_t) temporal.
months();
118 const char *month_name;
119 uint32_t month= (uint)
val_int();
127 month_name= getSession().
variables.lc_time_names->month_names->type_names[month-1];
128 str->set(month_name, strlen(month_name), system_charset_info);