~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-10-28 17:12:01 UTC
  • mfrom: (1887.1.3 merge)
  • Revision ID: brian@tangent.org-20101028171201-baj6l1bnntn1s4ad
Merge in POTFILES changes.

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, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
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
37
37
 
38
38
  /* We don't need to set second_part and neg because they already 0 */
39
39
  ltime.hour= ltime.minute= ltime.second= 0;
40
 
  ltime.time_type= type::DRIZZLE_TIMESTAMP_DATE;
 
40
  ltime.time_type= DRIZZLE_TIMESTAMP_DATE;
41
41
 
42
42
  /** 
43
43
   * @TODO Remove ltime completely when timezones are reworked.  Using this
49
49
}
50
50
 
51
51
/**
52
 
    Converts current time in time_t to type::Time represenatation for local
 
52
    Converts current time in time_t to DRIZZLE_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(type::Time *now_time)
 
55
void Item_func_curdate_local::store_now_in_TIME(DRIZZLE_TIME *now_time)
56
56
{
57
57
  Session *session= current_session;
58
 
  time_t tmp= session->getCurrentTimestampEpoch();
 
58
  time_t tmp= session->query_start();
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;
69
68
}
70
69
 
71
70
/**
72
 
    Converts current time in time_t to type::Time represenatation for UTC
 
71
    Converts current time in time_t to DRIZZLE_TIME represenatation for UTC
73
72
    time zone. Defines time zone (UTC) used for whole UTC_DATE function.
74
73
*/
75
 
void Item_func_curdate_utc::store_now_in_TIME(type::Time *now_time)
 
74
void Item_func_curdate_utc::store_now_in_TIME(DRIZZLE_TIME *now_time)
76
75
{
77
76
  Session *session= current_session;
78
 
  time_t tmp= session->getCurrentTimestampEpoch();
 
77
  time_t tmp= session->query_start();
79
78
 
80
79
  (void) cached_temporal.from_time_t(tmp);
81
80
 
85
84
  now_time->hour= 0;
86
85
  now_time->minute= 0;
87
86
  now_time->second= 0;
88
 
  now_time->second_part= 0;
89
87
}
90
88
 
91
89
bool Item_func_curdate::get_temporal(Date &to)