21 #include <boost/lexical_cast.hpp>
22 #include <drizzled/function/time/from_unixtime.h>
23 #include <drizzled/current_session.h>
24 #include <drizzled/session.h>
26 #include <drizzled/time_functions.h>
27 #include <drizzled/field.h>
35 void Item_func_from_unixtime::fix_length_and_dec()
37 session= current_session;
38 collation.set(&my_charset_bin);
39 decimals= DATETIME_DEC;
40 max_length=type::Time::MAX_STRING_LENGTH*MY_CHARSET_BIN_MB_MAXLEN;
53 str->alloc(type::Time::MAX_STRING_LENGTH);
55 time_tmp.convert(*str);
70 time_tmp.convert(ret);
78 type::usec_t fractional_tmp= 0;
80 switch (args[0]->result_type()) {
86 double double_tmp= args[0]->
val_real();
88 tmp= (uint64_t)(double_tmp);
89 fractional_tmp= (type::usec_t)((uint64_t)((double_tmp - tmp) * type::Time::FRACTIONAL_DIGITS) % type::Time::FRACTIONAL_DIGITS);
95 tmp= (uint64_t)(args[0]->
val_int());
107 ltime.store(tmp, fractional_tmp);
String * val_str(String *str)
TODO: Rename this file - func.h is stupid.
bool get_date(type::Time &res, uint32_t fuzzy_date)
virtual double val_real()=0