~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/uuid.cc

  • Committer: Brian Aker
  • Date: 2011-01-19 18:03:32 UTC
  • mfrom: (2088.8.12 timestamp)
  • mto: This revision was merged to the branch mainline in revision 2098.
  • Revision ID: brian@tangent.org-20110119180332-acfk5i8oofp63s40
Merge in time code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include "drizzled/internal/my_sys.h"
32
32
#include "drizzled/session.h"
33
33
#include "drizzled/table.h"
34
 
#include "drizzled/temporal.h"
35
34
 
36
35
namespace drizzled
37
36
{
167
166
 
168
167
  if (uu.isTimeType())
169
168
  {
170
 
    Timestamp temporal;
171
169
    struct timeval ret_tv;
172
170
 
173
 
    ret_tv.tv_sec= ret_tv.tv_usec= 0;
 
171
    memset(&ret_tv, 0, sizeof(struct timeval));
174
172
 
175
173
    uu.time(ret_tv);
176
174
 
177
 
    temporal.from_time_t(ret_tv.tv_sec);
178
 
 
179
 
    ltime->time_type= DRIZZLE_TIMESTAMP_DATETIME;
180
 
    ltime->year= temporal.years();
181
 
    ltime->month= temporal.months();
182
 
    ltime->day= temporal.days();
183
 
    ltime->hour= temporal.hours();
184
 
    ltime->minute= temporal.minutes();
185
 
    ltime->second= temporal.seconds();
186
 
    ltime->second_part= temporal.nseconds();
 
175
    ltime->store(ret_tv);
187
176
 
188
177
    return false;
189
178
  }
190
 
  memset(ltime, 0, sizeof(type::Time));
 
179
  ltime->reset();
191
180
 
192
181
  return true;
193
182
}