~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/temporal.cc

  • Committer: Monty Taylor
  • Date: 2010-12-27 19:41:48 UTC
  • mfrom: (2035 staging)
  • mto: This revision was merged to the branch mainline in revision 2038.
  • Revision ID: mordred@inaugust.com-20101227194148-nqd86au4o76pdltw
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include "config.h"
38
38
 
39
39
#include "drizzled/charset_info.h"
40
 
#include "drizzled/decimal.h"
 
40
#include "drizzled/type/decimal.h"
41
41
#include "drizzled/calendar.h"
42
42
#include "drizzled/temporal.h"
43
43
#include "drizzled/temporal_format.h"
1075
1075
                  _hours, _minutes, _seconds, _useconds);
1076
1076
}
1077
1077
 
1078
 
void Time::to_decimal(my_decimal *to) const
 
1078
void Time::to_decimal(type::Decimal *to) const
1079
1079
{
1080
1080
  int64_t time_portion= (((_hours * 100L) + _minutes) * 100L) + _seconds;
1081
 
  (void) int2my_decimal(E_DEC_FATAL_ERROR, time_portion, false, to);
 
1081
  (void) int2_class_decimal(E_DEC_FATAL_ERROR, time_portion, false, to);
1082
1082
  if (_useconds > 0)
1083
1083
  {
1084
1084
    to->buf[(to->intg-1) / 9 + 1]= _useconds * 1000;
1086
1086
  }
1087
1087
}
1088
1088
 
1089
 
void Date::to_decimal(my_decimal *to) const
 
1089
void Date::to_decimal(type::Decimal *to) const
1090
1090
{
1091
1091
  int64_t date_portion= (((_years * 100L) + _months) * 100L) + _days;
1092
 
  (void) int2my_decimal(E_DEC_FATAL_ERROR, date_portion, false, to);
 
1092
  (void) int2_class_decimal(E_DEC_FATAL_ERROR, date_portion, false, to);
1093
1093
}
1094
1094
 
1095
 
void DateTime::to_decimal(my_decimal *to) const
 
1095
void DateTime::to_decimal(type::Decimal *to) const
1096
1096
{
1097
1097
  int64_t date_portion= (((_years * 100L) + _months) * 100L) + _days;
1098
1098
  int64_t time_portion= (((((date_portion * 100L) + _hours) * 100L) + _minutes) * 100L) + _seconds;
1099
 
  (void) int2my_decimal(E_DEC_FATAL_ERROR, time_portion, false, to);
 
1099
  (void) int2_class_decimal(E_DEC_FATAL_ERROR, time_portion, false, to);
1100
1100
  if (_useconds > 0)
1101
1101
  {
1102
1102
    to->buf[(to->intg-1) / 9 + 1]= _useconds * 1000;