~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/timestamp.cc

  • Committer: Monty Taylor
  • Date: 2008-11-17 07:23:53 UTC
  • mto: (589.1.3 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081117072353-tc8ykdsycno0cc5u
Split out a little more code. Removed table_list.h from common_includes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
443
443
  store_timestamp(tmp);
444
444
}
445
445
 
 
446
 
 
447
void Field_timestamp::set_default()
 
448
{
 
449
  if (table->timestamp_field == this &&
 
450
      unireg_check != TIMESTAMP_UN_FIELD)
 
451
    set_time();
 
452
  else
 
453
    Field::set_default();
 
454
}
 
455
 
 
456
long Field_timestamp::get_timestamp(bool *null_value)
 
457
{
 
458
  if ((*null_value= is_null()))
 
459
    return 0;
 
460
#ifdef WORDS_BIGENDIAN
 
461
  if (table && table->s->db_low_byte_first)
 
462
    return sint4korr(ptr);
 
463
#endif
 
464
  long tmp;
 
465
  longget(tmp,ptr);
 
466
  return tmp;
 
467
}
 
468
 
 
469
 
 
470
void Field_timestamp::store_timestamp(my_time_t timestamp)
 
471
{
 
472
#ifdef WORDS_BIGENDIAN
 
473
  if (table && table->s->db_low_byte_first)
 
474
  {
 
475
    int4store(ptr,timestamp);
 
476
  }
 
477
  else
 
478
#endif
 
479
    longstore(ptr,(uint32_t) timestamp);
 
480
}
 
481