~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/epoch.cc

  • Committer: Brian Aker
  • Date: 2011-01-05 17:21:13 UTC
  • mto: (2057.2.1 clean)
  • mto: This revision was merged to the branch mainline in revision 2064.
  • Revision ID: brian@tangent.org-20110105172113-s7mng3puod6o9n3y
Add basic tests for microtime.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
               const char *field_name_arg,
89
89
               drizzled::TableShare *share) :
90
90
  Field_str(ptr_arg,
91
 
            DateTime::MAX_STRING_LENGTH - 1 /* no \0 */,
 
91
            MicroTimestamp::MAX_STRING_LENGTH - 1 /* no \0 */,
92
92
            null_ptr_arg,
93
93
            null_bit_arg,
94
94
            field_name_arg,
108
108
Epoch::Epoch(bool maybe_null_arg,
109
109
             const char *field_name_arg) :
110
110
  Field_str((unsigned char*) NULL,
111
 
            DateTime::MAX_STRING_LENGTH - 1 /* no \0 */,
 
111
            MicroTimestamp::MAX_STRING_LENGTH - 1 /* no \0 */,
112
112
            maybe_null_arg ? (unsigned char*) "": 0,
113
113
            0,
114
114
            field_name_arg,
169
169
  time_t tmp;
170
170
  temporal.to_time_t(tmp);
171
171
 
172
 
  pack_num(tmp);
 
172
  uint64_t time_tmp= tmp;
 
173
  pack_num(time_tmp);
173
174
  return 0;
174
175
}
175
176
 
213
214
  time_t tmp;
214
215
  temporal.to_time_t(tmp);
215
216
 
216
 
  pack_num(tmp);
 
217
  uint64_t tmp64= tmp;
 
218
  pack_num(tmp64);
217
219
 
218
220
  return 0;
219
221
}
340
342
void Epoch::set_time()
341
343
{
342
344
  Session *session= getTable() ? getTable()->in_use : current_session;
343
 
  time_t tmp= session->query_start();
 
345
  uint64_t tmp= session->query_start();
344
346
  set_notnull();
345
347
  pack_num(tmp);
346
348
}