22 #include <drizzled/function/time/now.h>
23 #include <drizzled/current_session.h>
24 #include <drizzled/session.h>
25 #include <drizzled/session/times.h>
27 #include <drizzled/field.h>
34 str_value.set(buff, buff_length, &my_charset_bin);
40 void Item_func_now::fix_length_and_dec()
42 decimals= DATETIME_DEC;
43 collation.set(&my_charset_bin);
47 ltime.time_type= type::DRIZZLE_TIMESTAMP_DATETIME;
49 store_now_in_TIME(ltime);
53 size_t length= type::Time::MAX_STRING_LENGTH;
54 ltime.convert(buff, length);
56 max_length= buff_length= length;
65 Session *session= current_session;
66 uint32_t fractional_seconds= 0;
67 time_t tmp= session->times.getCurrentTimestampEpoch(fractional_seconds);
70 now_time->store(tmp, fractional_seconds,
true);
72 now_time.store(tmp, fractional_seconds);
82 uint32_t fractional_seconds= 0;
83 time_t tmp= current_session->times.getCurrentTimestampEpoch(fractional_seconds);
84 now_time.store(tmp, fractional_seconds);
100 int Item_func_now::save_in_field(
Field *to,
bool )
103 return to->
store_time(ltime, type::DRIZZLE_TIMESTAMP_DATETIME);
virtual int store_time(type::Time <ime, type::timestamp_t t_type)
virtual void store_now_in_TIME(type::Time &now_time)
virtual void store_now_in_TIME(type::Time &now_time)
String * val_str(String *str)
bool get_date(type::Time &res, uint32_t fuzzy_date)
bool get_temporal(DateTime &temporal)