~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/date.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:
34
34
  if (! get_temporal(temporal))
35
35
    return (String *) NULL; /* get_temporal throws error. */
36
36
 
37
 
  if (str->alloc(MAX_DATE_STRING_REP_LENGTH))
 
37
  if (str->alloc(type::Time::MAX_STRING_LENGTH))
38
38
  {
39
39
    null_value= true;
40
40
    return (String *) NULL;
41
41
  }
42
42
 
43
43
  /* Convert the Date to a string and return it */
44
 
  int new_length;
45
 
  new_length= temporal.to_string(str->c_ptr(), MAX_DATE_STRING_REP_LENGTH);
46
 
  assert(new_length < MAX_DATE_STRING_REP_LENGTH);
 
44
  size_t new_length;
 
45
  new_length= temporal.to_string(str->c_ptr(), type::Time::MAX_STRING_LENGTH);
 
46
  assert(new_length < type::Time::MAX_STRING_LENGTH);
47
47
  str->length(new_length);
48
48
  return str;
49
49
}