~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/hex_functions/hex_functions.cc

  • Committer: Olaf van der Spek
  • Date: 2011-04-14 21:56:22 UTC
  • mto: (2279.1.1 build) (2280.2.2 build)
  • mto: This revision was merged to the branch mainline in revision 2280.
  • Revision ID: olafvdspek@gmail.com-20110414215622-5b590ajxlwqqiyi0
Return void

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
 
110
110
  /* Convert given string to a hex string, character by character */
111
111
  res= args[0]->val_str(str);
112
 
  if (!res || tmp_value.alloc(res->length()*2+1))
 
112
  if (!res)
113
113
  {
114
114
    null_value=1;
115
115
    return 0;
116
116
  }
117
117
  null_value=0;
 
118
  tmp_value.alloc(res->length()*2+1);
118
119
  tmp_value.length(res->length()*2);
119
120
 
120
121
  (void) drizzled_string_to_hex((char*) tmp_value.ptr(), res->ptr(),
133
134
  assert(fixed == 1);
134
135
 
135
136
  res= args[0]->val_str(str);
136
 
  if (!res || tmp_value.alloc(length= (1+res->length())/2))
 
137
  if (!res)
137
138
  {
138
139
    null_value=1;
139
140
    return 0;
140
141
  }
 
142
  tmp_value.alloc(length= (1+res->length())/2);
141
143
 
142
144
  from= res->ptr();
143
145
  null_value= 0;