~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/temporal_interval.cc

Merged Pawel from lp:~pblokus/drizzle/unittests-plugin-interfaces

Show diffs side-by-side

added added

removed removed

Lines of Context:
311
311
    const char *start= str;
312
312
    for (value= 0 ; str != end && my_isdigit(cs,*str) ; str++)
313
313
      value= value * 10L + (int64_t) (*str - '0');
314
 
    if (transform_msec && x == count - 1) // microseconds always last
 
314
    if (transform_msec && (x == count - 1 || str == end)) // microseconds always last
315
315
    {
316
316
      long msec_length= 6 - (str - start);
317
317
      if (msec_length > 0)
323
323
    if (str == end && x != count-1)
324
324
    {
325
325
      x++;
326
 
      /* Change values[0...x-1] -> values[0...count-1] */
 
326
      /* Change values[0...x-1] -> values[count-x...count-1] */
327
327
      internal::bmove_upp((unsigned char*) (values+count),
328
328
                          (unsigned char*) (values+x),
329
329
                          sizeof(*values)*x);