~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/substr_functions/substr_functions.cc

merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
      (args[1]->unsigned_flag && ((uint64_t) start > INT32_MAX)))
87
87
    return &my_empty_string;
88
88
 
89
 
  start= ((start < 0) ? res->numchars() + start : start - 1);
 
89
  start= ((start < 0) ?
 
90
          static_cast<int64_t>(res->numchars() + start)
 
91
          : start - 1);
90
92
  start= res->charpos((int) start);
91
93
  if ((start < 0) || ((uint) start + 1 > res->length()))
92
94
    return &my_empty_string;