~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/now.cc

  • Committer: Brian Aker
  • Date: 2011-01-08 10:35:13 UTC
  • mfrom: (2057.2.9 timestamp)
  • Revision ID: brian@tangent.org-20110108103513-3wuo8tsyajjcxjrg
Merge in fractional seconds to timestamp.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
void Item_func_now_local::store_now_in_TIME(type::Time *now_time)
59
59
{
60
60
  Session *session= current_session;
61
 
  time_t tmp= session->query_start();
 
61
  uint32_t fractional_seconds= 0;
 
62
  time_t tmp= session->getCurrentTimestampEpoch(fractional_seconds);
62
63
 
63
64
  (void) cached_temporal.from_time_t(tmp);
64
65
 
68
69
  now_time->hour= cached_temporal.hours();
69
70
  now_time->minute= cached_temporal.minutes();
70
71
  now_time->second= cached_temporal.seconds();
 
72
  now_time->second_part= fractional_seconds;
71
73
}
72
74
 
73
75
 
78
80
void Item_func_now_utc::store_now_in_TIME(type::Time *now_time)
79
81
{
80
82
  Session *session= current_session;
81
 
  time_t tmp= session->query_start();
 
83
  uint32_t fractional_seconds= 0;
 
84
  time_t tmp= session->getCurrentTimestampEpoch(fractional_seconds);
82
85
 
83
86
  (void) cached_temporal.from_time_t(tmp);
84
87
 
88
91
  now_time->hour= cached_temporal.hours();
89
92
  now_time->minute= cached_temporal.minutes();
90
93
  now_time->second= cached_temporal.seconds();
 
94
  now_time->second_part= fractional_seconds;
91
95
}
92
96
 
93
97
bool Item_func_now::get_temporal(DateTime &to)