~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_string.cc

  • Committer: Olaf van der Spek
  • Date: 2011-07-04 14:32:29 UTC
  • mto: This revision was merged to the branch mainline in revision 2367.
  • Revision ID: olafvdspek@gmail.com-20110704143229-70ssw23smubzdcru
Remove String::set_or_copy_aligned()

Show diffs side-by-side

added added

removed removed

Lines of Context:
234
234
bool String::needs_conversion(size_t arg_length, const charset_info_st* from_cs, const charset_info_st* to_cs)
235
235
{
236
236
  if (!to_cs ||
237
 
      (to_cs == &my_charset_bin) ||
238
 
      (to_cs == from_cs) ||
 
237
      to_cs == &my_charset_bin ||
 
238
      to_cs == from_cs ||
239
239
      my_charset_same(from_cs, to_cs) ||
240
 
      ((from_cs == &my_charset_bin) && (!(arg_length % to_cs->mbminlen))))
 
240
      (from_cs == &my_charset_bin && not (arg_length % to_cs->mbminlen)))
241
241
    return false;
242
242
  return true;
243
243
}
244
244
 
245
 
void String::set_or_copy_aligned(const char *str,size_t arg_length, const charset_info_st* cs)
246
 
{
247
 
  /* How many bytes are in incomplete character */
248
 
  size_t offset= (arg_length % cs->mbminlen);
249
 
 
250
 
  assert(!offset); /* All characters are complete, just copy */
251
 
 
252
 
  set(str, arg_length, cs);
253
 
}
254
 
 
255
245
/*
256
246
  Set a string to the value of a latin1-string, keeping the original charset
257
247