~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/microtime.cc

  • Committer: Brian Aker
  • Date: 2011-01-18 00:08:34 UTC
  • mto: (2097.1.1 drizzle-build)
  • mto: This revision was merged to the branch mainline in revision 2098.
  • Revision ID: brian@tangent.org-20110118000834-a1p3mves421202oy
Fix additional output, swaps for the valus.

Show diffs side-by-side

added added

removed removed

Lines of Context:
209
209
{
210
210
  uint64_t temp= 0;
211
211
  type::Time::usec_t micro_temp= 0;
212
 
  char *to;
213
 
  int to_len= field_length + 1 + 8;
214
 
 
215
 
  val_buffer->alloc(to_len);
216
 
  to= (char *) val_buffer->ptr();
217
212
 
218
213
  unpack_num(temp);
219
214
  unpack_num(micro_temp, ptr +8);
220
215
 
221
 
  val_buffer->set_charset(&my_charset_bin);     /* Safety */
222
 
 
223
 
  struct timeval buffer;
224
 
  buffer.tv_sec= temp;
225
 
  buffer.tv_usec= micro_temp;
226
 
 
227
 
  MicroTimestamp temporal;
228
 
  (void) temporal.from_timeval(buffer);
229
 
 
230
 
  int rlen= temporal.to_string(to, to_len);
231
 
  assert(rlen <= to_len);
232
 
 
233
 
  val_buffer->length(rlen);
 
216
  type::Time tmp_time;
 
217
  tmp_time.store(temp, micro_temp);
 
218
 
 
219
  tmp_time.convert(*val_buffer);
 
220
 
234
221
 
235
222
  return val_buffer;
236
223
}