23 #include <drizzled/error.h>
24 #include <drizzled/function/time/hour.h>
57 char time_buff[DRIZZLE_MAX_LENGTH_DATETIME_AS_STRING];
58 String tmp_time(time_buff,
sizeof(time_buff), &my_charset_utf8_bin);
61 if (time_res && (time_res != &tmp_time))
63 tmp_time.copy(*time_res);
66 if (! temporal_time.
from_string(tmp_time.c_ptr(), tmp_time.length()))
74 Item_result arg0_result_type= args[0]->result_type();
76 switch (arg0_result_type)
89 char buff[DRIZZLE_MAX_LENGTH_DATETIME_AS_STRING];
90 String tmp(buff,
sizeof(buff), &my_charset_utf8_bin);
93 if (res && (res != &tmp))
98 if (! temporal_datetime.
from_string(tmp.c_ptr(), tmp.length()))
104 my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
120 char buff[DRIZZLE_MAX_LENGTH_DATETIME_AS_STRING];
121 String tmp(buff,
sizeof(buff), &my_charset_utf8_bin);
126 if (res && (res != &tmp))
131 my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
135 return (int64_t) temporal_datetime.
hours();
137 return (int64_t) temporal_time.
hours();
bool from_string(const char *from, size_t from_len)
bool from_string(const char *from, size_t from_len)
virtual int64_t val_int()=0
TODO: Rename this file - func.h is stupid.
bool from_int64_t(const int64_t from, bool convert)
virtual String * val_str(String *str)=0