~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/date_add_interval.cc

Merge Stewart

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
  collation.set(&my_charset_bin);
46
46
  maybe_null=1;
47
 
  max_length=MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
 
47
  max_length=drizzled::DateTime::MAX_STRING_LENGTH*MY_CHARSET_BIN_MB_MAXLEN;
48
48
  value.alloc(max_length);
49
49
 
50
50
  /*
104
104
  else if (ltime.second_part)
105
105
  {
106
106
    /* Ensure we've got enough room for our timestamp string. */
107
 
    str->length(MAX_DATETIME_FULL_WIDTH);
108
 
    size_t length= sprintf(str->c_ptr(), "%04u-%02u-%02u %02u:%02u:%02u.%06u",
109
 
                          ltime.year,
110
 
                          ltime.month,
111
 
                          ltime.day,
112
 
                          ltime.hour,
113
 
                          ltime.minute,
114
 
                          ltime.second,
115
 
                          (uint32_t) ltime.second_part);
 
107
    str->length(drizzled::DateTime::MAX_STRING_LENGTH);
 
108
    size_t length= snprintf(str->c_ptr(), drizzled::DateTime::MAX_STRING_LENGTH,
 
109
                            "%04u-%02u-%02u %02u:%02u:%02u.%06u",
 
110
                            ltime.year,
 
111
                            ltime.month,
 
112
                            ltime.day,
 
113
                            ltime.hour,
 
114
                            ltime.minute,
 
115
                            ltime.second,
 
116
                            (uint32_t) ltime.second_part);
116
117
    str->length(length);
117
118
    str->set_charset(&my_charset_bin);
118
119
  }