~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/hex_string.cc

  • Committer: Mark Atwood
  • Date: 2011-10-14 15:59:08 UTC
  • mfrom: (2430.1.12 refactor3a)
  • Revision ID: me@mark.atwood.name-20111014155908-whqmrmaf2grpsg5c
mergeĀ lp:~olafvdspek/drizzle/refactor3

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
                 X-'a'+10);
41
41
}
42
42
 
43
 
Item_hex_string::Item_hex_string(const char *str, uint32_t str_length)
 
43
Item_hex_string::Item_hex_string(str_ref arg)
44
44
{
45
 
  max_length=(str_length+1)/2;
 
45
  max_length= (arg.size() + 1) / 2;
46
46
  char *ptr=(char*) memory::sql_alloc(max_length+1);
47
47
  if (!ptr)
48
48
    return;
49
49
  str_value.set(ptr,max_length,&my_charset_bin);
 
50
  const char *str= arg.data();
50
51
  char *end=ptr+max_length;
51
 
  if (max_length*2 != str_length)
 
52
  if (max_length * 2 != arg.size())
52
53
    *ptr++=char_val(*str++);                    // Not even, assume 0 prefix
53
54
  while (ptr != end)
54
55
  {