~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/bin_string.cc

  • Committer: Olaf van der Spek
  • Date: 2011-10-17 21:39:27 UTC
  • mto: This revision was merged to the branch mainline in revision 2442.
  • Revision ID: olafvdspek@gmail.com-20111017213927-wa77gvp34yxcb4uk
Use str_ref

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
Item_bin_string::Item_bin_string(str_ref str_arg)
32
32
{
33
33
  const char *str= str_arg.data();
34
 
  uint32_t str_length = str_arg.size();
35
 
  const char *end= str + str_length - 1;
 
34
  const char *end= str + str_arg.size() - 1;
36
35
  unsigned char bits= 0;
37
36
  uint32_t power= 1;
38
37
 
39
 
  max_length= (str_length + 7) >> 3;
 
38
  max_length= (str_arg.size() + 7) >> 3;
40
39
  char *ptr= (char*) memory::sql_alloc(max_length + 1);
41
 
  if (!ptr)
42
 
    return;
43
40
  str_value.set(ptr, max_length, &my_charset_bin);
44
41
  ptr+= max_length - 1;
45
42
  ptr[1]= 0;                     // Set end null for string