~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Stewart Smith
  • Date: 2011-01-14 05:18:23 UTC
  • mto: (2086.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2087.
  • Revision ID: stewart@flamingspork.com-20110114051823-14fyn2kvg8pc5a15
\r and trailing whitespace removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
49
49
}
50
50
 
51
51
/**
52
 
    Converts current time in time_t to DRIZZLE_TIME represenatation for local
 
52
    Converts current time in time_t to type::Time represenatation for local
53
53
    time zone. Defines time zone (local) used for whole CURDATE function.
54
54
*/
55
 
void Item_func_curdate_local::store_now_in_TIME(DRIZZLE_TIME *now_time)
 
55
void Item_func_curdate_local::store_now_in_TIME(type::Time *now_time)
56
56
{
57
57
  Session *session= current_session;
58
 
  time_t tmp= session->query_start();
 
58
  time_t tmp= session->getCurrentTimestampEpoch();
59
59
 
60
60
  (void) cached_temporal.from_time_t(tmp);
61
61
 
65
65
  now_time->hour= 0;
66
66
  now_time->minute= 0;
67
67
  now_time->second= 0;
 
68
  now_time->second_part= 0;
68
69
}
69
70
 
70
71
/**
71
 
    Converts current time in time_t to DRIZZLE_TIME represenatation for UTC
 
72
    Converts current time in time_t to type::Time represenatation for UTC
72
73
    time zone. Defines time zone (UTC) used for whole UTC_DATE function.
73
74
*/
74
 
void Item_func_curdate_utc::store_now_in_TIME(DRIZZLE_TIME *now_time)
 
75
void Item_func_curdate_utc::store_now_in_TIME(type::Time *now_time)
75
76
{
76
77
  Session *session= current_session;
77
 
  time_t tmp= session->query_start();
 
78
  time_t tmp= session->getCurrentTimestampEpoch();
78
79
 
79
80
  (void) cached_temporal.from_time_t(tmp);
80
81
 
84
85
  now_time->hour= 0;
85
86
  now_time->minute= 0;
86
87
  now_time->second= 0;
 
88
  now_time->second_part= 0;
87
89
}
88
90
 
89
91
bool Item_func_curdate::get_temporal(Date &to)