~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/handler/i_s.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:
17
17
#include "i_s.h"
18
18
#include <mysql/plugin.h>
19
19
 
 
20
#include "drizzled/temporal.h"
 
21
 
20
22
extern "C" {
21
23
#include "trx0i_s.h"
22
24
#include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */
129
131
        Field*  field,  /* in/out: target field for storage */
130
132
        time_t  time)   /* in: value to store */
131
133
{
132
 
        MYSQL_TIME      my_time;
133
 
        struct tm       tm_time;
134
 
 
135
 
#if 0
136
 
        /* use this if you are sure that `variables' and `time_zone'
137
 
        are always initialized */
138
 
        thd->variables.time_zone->gmt_sec_to_TIME(
139
 
                &my_time, (time_t) time);
140
 
#else
141
 
        localtime_r(&time, &tm_time);
142
 
        localtime_to_TIME(&my_time, &tm_time);
143
 
        my_time.time_type = MYSQL_TIMESTAMP_DATETIME;
144
 
#endif
145
 
 
146
 
        return(field->store_time(&my_time, MYSQL_TIMESTAMP_DATETIME));
 
134
  drizzled::Timestamp timestamp;
 
135
  (void) timestamp.from_time_t(time);
 
136
  char tmp_string[MAX_DATETIME_WIDTH];
 
137
  size_t tmp_string_length;
 
138
 
 
139
  timestamp.to_string(tmp_string, &tmp_string_length);
 
140
 
 
141
        return(field->store(tmp_string, tmp_string_length, &my_charset_bin));
147
142
}
148
143
 
149
144
/***********************************************************************