~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field.cc

  • Committer: Brian Aker
  • Date: 2011-01-25 07:22:15 UTC
  • mfrom: (2109.1.7 drizzle-build)
  • Revision ID: brian@tangent.org-20110125072215-567z6uzy5vdvn4va
Merge in build/timestamp patches/fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1010
1010
  return copy->length+ store_length;
1011
1011
}
1012
1012
 
1013
 
bool Field::get_date(type::Time *ltime,uint32_t fuzzydate)
 
1013
bool Field::get_date(type::Time &ltime,uint32_t fuzzydate)
1014
1014
{
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) <= type::DRIZZLE_TIMESTAMP_ERROR)
 
1018
                                                                 &ltime, fuzzydate) <= type::DRIZZLE_TIMESTAMP_ERROR)
1019
1019
  {
1020
1020
    return 1;
1021
1021
  }
1023
1023
  return 0;
1024
1024
}
1025
1025
 
1026
 
bool Field::get_time(type::Time *ltime)
 
1026
bool Field::get_time(type::Time &ltime)
1027
1027
{
1028
1028
  char buff[40];
1029
1029
  String tmp(buff,sizeof(buff),&my_charset_bin),*res;
1030
1030
 
1031
 
  if (!(res=val_str_internal(&tmp)) || str_to_time_with_warn(res->ptr(), res->length(), ltime))
 
1031
  if (!(res=val_str_internal(&tmp)) || str_to_time_with_warn(res->ptr(), res->length(), &ltime))
1032
1032
  {
1033
1033
    return 1;
1034
1034
  }
1036
1036
  return 0;
1037
1037
}
1038
1038
 
1039
 
int Field::store_time(type::Time *ltime, type::timestamp_t)
 
1039
int Field::store_time(type::Time &ltime, type::timestamp_t)
1040
1040
{
1041
1041
  String tmp;
1042
1042
 
1043
 
  ltime->convert(tmp);
 
1043
  ltime.convert(tmp);
1044
1044
 
1045
1045
  return store(tmp.ptr(), tmp.length(), &my_charset_bin);
1046
1046
}