~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2009-03-05 02:06:48 UTC
  • mfrom: (907.1.8 trunk-with-temporal)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: mordred@inaugust.com-20090305020648-7jk1gie4lqsi22g8
Merged from Jay.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
void Item_func_curdate_local::store_now_in_TIME(DRIZZLE_TIME *now_time)
53
53
{
54
54
  Session *session= current_session;
55
 
  session->variables.time_zone->gmt_sec_to_TIME(now_time,
56
 
                                                (time_t)session->query_start());
 
55
  time_t tmp= session->query_start();
 
56
 
 
57
  (void) cached_temporal.from_time_t(tmp);
 
58
 
 
59
  now_time->year= cached_temporal.years();
 
60
  now_time->month= cached_temporal.months();
 
61
  now_time->day= cached_temporal.days();
 
62
  now_time->hour= 0;
 
63
  now_time->minute= 0;
 
64
  now_time->second= 0;
57
65
}
58
66
 
59
67
/**
62
70
*/
63
71
void Item_func_curdate_utc::store_now_in_TIME(DRIZZLE_TIME *now_time)
64
72
{
65
 
  my_tz_UTC->gmt_sec_to_TIME(now_time,
66
 
                             (time_t)(current_session->query_start()));
67
 
  /*
68
 
    We are not flagging this query as using time zone, since it uses fixed
69
 
    UTC-SYSTEM time-zone.
70
 
  */
 
73
  Session *session= current_session;
 
74
  time_t tmp= session->query_start();
 
75
 
 
76
  (void) cached_temporal.from_time_t(tmp);
 
77
 
 
78
  now_time->year= cached_temporal.years();
 
79
  now_time->month= cached_temporal.months();
 
80
  now_time->day= cached_temporal.days();
 
81
  now_time->hour= 0;
 
82
  now_time->minute= 0;
 
83
  now_time->second= 0;
71
84
}
72
85
 
73
86
bool Item_func_curdate::get_temporal(drizzled::Date &to)