84 if (args[0]->result_type() != STRING_RESULT)
89 if (args[0]->result_type() == REAL_RESULT ||
90 args[0]->result_type() == DECIMAL_RESULT)
92 double val= args[0]->val_real();
93 if ((val <= (
double) INT64_MIN) ||
94 (val >= (
double) (uint64_t) UINT64_MAX))
97 dec= (uint64_t) (val + (val > 0 ? 0.5 : -0.5));
100 dec= (uint64_t) args[0]->
val_int();
104 ptr= internal::int64_t2str(dec,ans,16);
105 str->copy(ans,(uint32_t) (ptr-ans),default_charset());
110 res= args[0]->val_str(str);
117 tmp_value.alloc(res->length()*2+1);
118 tmp_value.length(res->length()*2);
120 (void) drizzled_string_to_hex((
char*) tmp_value.ptr(), res->ptr(),
129 const char *from, *end;
135 res= args[0]->val_str(str);
141 tmp_value.alloc(length= (1+res->length())/2);
145 tmp_value.length(length);
146 to= (
char*) tmp_value.ptr();
147 if (res->length() % 2)
150 *to++= hex_char= hexchar_to_int(*from++);
154 for (end=res->ptr()+res->length(); from < end ; from+=2, to++)
157 *to= (hex_char= hexchar_to_int(from[0])) << 4;
160 *to|= hex_char= hexchar_to_int(from[1]);