~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Jay Pipes
  • Date: 2009-02-28 17:49:44 UTC
  • mto: (910.2.6 mordred-noatomics)
  • mto: This revision was merged to the branch mainline in revision 908.
  • Revision ID: jpipes@serialcoder-20090228174944-js0x7xrxtoiwymnb
Merging in old r904 temporal changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
  return 0;
92
92
}
93
93
 
94
 
 
95
94
String *Item_date_add_interval::val_str(String *str)
96
95
{
97
96
  assert(fixed == 1);
104
103
    make_date(&ltime, str);
105
104
  else if (ltime.second_part)
106
105
  {
107
 
    uint32_t length= sprintf(str->c_ptr(), "%04u-%02u-%02u %02u:%02u:%02u.%06u",
 
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",
108
109
                          ltime.year,
109
110
                          ltime.month,
110
111
                          ltime.day,
121
122
  return str;
122
123
}
123
124
 
124
 
 
125
125
int64_t Item_date_add_interval::val_int()
126
126
{
127
127
  assert(fixed == 1);