~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-25 05:20:15 UTC
  • mto: (2109.1.6 drizzle-build)
  • mto: This revision was merged to the branch mainline in revision 2112.
  • Revision ID: brian@tangent.org-20110125052015-nw5jhmiq0at1qt9u
Merge in reference from pointer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
  ltime.time_type= type::DRIZZLE_TIMESTAMP_DATETIME;
47
47
 
48
 
  store_now_in_TIME(&ltime);
 
48
  store_now_in_TIME(ltime);
49
49
 
50
50
  ltime.convert(value);
51
51
 
59
59
    Converts current time in time_t to type::Time represenatation for local
60
60
    time zone. Defines time zone (local) used for whole NOW function.
61
61
*/
62
 
void Item_func_now_local::store_now_in_TIME(type::Time *now_time)
 
62
void Item_func_now_local::store_now_in_TIME(type::Time &now_time)
63
63
{
64
64
  Session *session= current_session;
65
65
  uint32_t fractional_seconds= 0;
68
68
#if 0
69
69
  now_time->store(tmp, fractional_seconds, true);
70
70
#endif
71
 
  now_time->store(tmp, fractional_seconds);
 
71
  now_time.store(tmp, fractional_seconds);
72
72
}
73
73
 
74
74
 
76
76
    Converts current time in time_t to type::Time represenatation for UTC
77
77
    time zone. Defines time zone (UTC) used for whole UTC_TIMESTAMP function.
78
78
*/
79
 
void Item_func_now_utc::store_now_in_TIME(type::Time *now_time)
 
79
void Item_func_now_utc::store_now_in_TIME(type::Time &now_time)
80
80
{
81
81
  Session *session= current_session;
82
82
  uint32_t fractional_seconds= 0;
83
83
  time_t tmp= session->getCurrentTimestampEpoch(fractional_seconds);
84
84
 
85
 
  now_time->store(tmp, fractional_seconds);
 
85
  now_time.store(tmp, fractional_seconds);
86
86
}
87
87
 
88
88
bool Item_func_now::get_temporal(DateTime &to)
91
91
  return true;
92
92
}
93
93
 
94
 
bool Item_func_now::get_date(type::Time *res, uint32_t )
 
94
bool Item_func_now::get_date(type::Time &res, uint32_t )
95
95
{
96
 
  *res= ltime;
 
96
  res= ltime;
97
97
  return 0;
98
98
}
99
99