23 #include <drizzled/error.h>
24 #include <drizzled/function/time/year.h>
42 Item_result arg0_result_type= args[0]->result_type();
44 switch (arg0_result_type)
57 char buff[DRIZZLE_MAX_LENGTH_DATETIME_AS_STRING];
58 String tmp(buff,
sizeof(buff), &my_charset_utf8_bin);
61 if (res && (res != &tmp))
66 if (! temporal.
from_string(tmp.c_ptr(), tmp.length()))
72 my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
88 char buff[DRIZZLE_MAX_LENGTH_DATETIME_AS_STRING];
89 String tmp(buff,
sizeof(buff), &my_charset_utf8_bin);
94 if (res && (res != &tmp))
99 my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
103 return (int64_t) temporal.
years();
136 if (!left_endp && temporal.
days() == 1 && temporal.
months() == 1 &&
141 return (int64_t) temporal.
years();
int64_t val_int_endpoint(bool left_endp, bool *incl_endp)
bool from_string(const char *from, size_t from_len)
virtual int64_t val_int()=0
uint32_t useconds() const
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