41
40
decimals= DATETIME_DEC;
42
41
collation.set(&my_charset_bin);
46
ltime.time_type= type::DRIZZLE_TIMESTAMP_DATETIME;
48
store_now_in_TIME(ltime);
52
size_t length= type::Time::MAX_STRING_LENGTH;
53
ltime.convert(buff, length);
55
max_length= buff_length= length;
43
memset(<ime, 0, sizeof(DRIZZLE_TIME));
45
ltime.time_type= DRIZZLE_TIMESTAMP_DATETIME;
47
store_now_in_TIME(<ime);
48
value= (int64_t) TIME_to_uint64_t_datetime(<ime);
50
buff_length= (uint) my_datetime_to_str(<ime, buff);
51
max_length= buff_length;
59
Converts current time in time_t to type::Time represenatation for local
55
Converts current time in time_t to DRIZZLE_TIME represenatation for local
60
56
time zone. Defines time zone (local) used for whole NOW function.
62
void Item_func_now_local::store_now_in_TIME(type::Time &now_time)
58
void Item_func_now_local::store_now_in_TIME(DRIZZLE_TIME *now_time)
64
60
Session *session= current_session;
65
uint32_t fractional_seconds= 0;
66
time_t tmp= session->getCurrentTimestampEpoch(fractional_seconds);
69
now_time->store(tmp, fractional_seconds, true);
71
now_time.store(tmp, fractional_seconds);
61
time_t tmp= session->query_start();
63
(void) cached_temporal.from_time_t(tmp);
65
now_time->year= cached_temporal.years();
66
now_time->month= cached_temporal.months();
67
now_time->day= cached_temporal.days();
68
now_time->hour= cached_temporal.hours();
69
now_time->minute= cached_temporal.minutes();
70
now_time->second= cached_temporal.seconds();
76
Converts current time in time_t to type::Time represenatation for UTC
75
Converts current time in time_t to DRIZZLE_TIME represenatation for UTC
77
76
time zone. Defines time zone (UTC) used for whole UTC_TIMESTAMP function.
79
void Item_func_now_utc::store_now_in_TIME(type::Time &now_time)
78
void Item_func_now_utc::store_now_in_TIME(DRIZZLE_TIME *now_time)
81
80
Session *session= current_session;
82
uint32_t fractional_seconds= 0;
83
time_t tmp= session->getCurrentTimestampEpoch(fractional_seconds);
85
now_time.store(tmp, fractional_seconds);
81
time_t tmp= session->query_start();
83
(void) cached_temporal.from_time_t(tmp);
85
now_time->year= cached_temporal.years();
86
now_time->month= cached_temporal.months();
87
now_time->day= cached_temporal.days();
88
now_time->hour= cached_temporal.hours();
89
now_time->minute= cached_temporal.minutes();
90
now_time->second= cached_temporal.seconds();
88
93
bool Item_func_now::get_temporal(DateTime &to)