~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field.cc

  • Committer: Brian Aker
  • Date: 2011-01-19 18:03:32 UTC
  • mfrom: (2088.8.12 timestamp)
  • mto: This revision was merged to the branch mainline in revision 2098.
  • Revision ID: brian@tangent.org-20110119180332-acfk5i8oofp63s40
Merge in time code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1015
1015
  char buff[40];
1016
1016
  String tmp(buff,sizeof(buff),&my_charset_bin),*res;
1017
1017
  if (!(res=val_str_internal(&tmp)) || str_to_datetime_with_warn(res->ptr(), res->length(),
1018
 
                                                                 ltime, fuzzydate) <= DRIZZLE_TIMESTAMP_ERROR)
 
1018
                                                                 ltime, fuzzydate) <= type::DRIZZLE_TIMESTAMP_ERROR)
1019
1019
  {
1020
1020
    return 1;
1021
1021
  }
1036
1036
  return 0;
1037
1037
}
1038
1038
 
1039
 
int Field::store_time(type::Time *ltime, enum enum_drizzle_timestamp_type)
 
1039
int Field::store_time(type::Time *ltime, type::timestamp_t)
1040
1040
{
1041
 
  char buff[MAX_DATE_STRING_REP_LENGTH];
1042
 
  uint32_t length= (uint32_t) my_TIME_to_str(ltime, buff);
1043
 
  return store(buff, length, &my_charset_bin);
 
1041
  String tmp;
 
1042
 
 
1043
  ltime->convert(tmp);
 
1044
 
 
1045
  return store(tmp.ptr(), tmp.length(), &my_charset_bin);
1044
1046
}
1045
1047
 
1046
1048
bool Field::optimize_range(uint32_t idx, uint32_t)
1195
1197
                                 drizzled::error_t code,
1196
1198
                                 const char *str, 
1197
1199
                                 uint32_t str_length,
1198
 
                                 enum enum_drizzle_timestamp_type ts_type, 
 
1200
                                 type::timestamp_t ts_type, 
1199
1201
                                 int cuted_increment)
1200
1202
{
1201
1203
  Session *session= table ? table->in_use : current_session;
1209
1211
void Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level, 
1210
1212
                                 drizzled::error_t code,
1211
1213
                                 int64_t nr, 
1212
 
                                 enum enum_drizzle_timestamp_type ts_type,
 
1214
                                 type::timestamp_t ts_type,
1213
1215
                                 int cuted_increment)
1214
1216
{
1215
1217
  Session *session= table ? table->in_use : current_session;
1226
1228
void Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level,
1227
1229
                                 const drizzled::error_t code,
1228
1230
                                 double nr, 
1229
 
                                 enum enum_drizzle_timestamp_type ts_type)
 
1231
                                 type::timestamp_t ts_type)
1230
1232
{
1231
1233
  Session *session= table ? table->in_use : current_session;
1232
1234
  if (session->really_abort_on_warning() ||