summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 0cd0ffcc38b..efd01d701b6 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -124,6 +124,7 @@ String *Item_func_md5::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
String * sptr= args[0]->val_str(str);
+ str->set_charset(&my_charset_bin);
if (sptr)
{
my_MD5_CTX context;
@@ -170,6 +171,7 @@ String *Item_func_sha::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
String * sptr= args[0]->val_str(str);
+ str->set_charset(&my_charset_bin);
if (sptr) /* If we got value different from NULL */
{
SHA1_CONTEXT context; /* Context used to generate SHA1 hash */
@@ -1605,7 +1607,7 @@ String *Item_func_encrypt::val_str(String *str)
null_value= 1;
return 0;
}
- str->set(tmp,(uint) strlen(tmp),res->charset());
+ str->set(tmp, (uint) strlen(tmp), &my_charset_bin);
str->copy();
pthread_mutex_unlock(&LOCK_crypt);
return str;
@@ -2041,7 +2043,7 @@ String *Item_func_make_set::val_str(String *str)
return &my_empty_string;
result= &tmp_str;
}
- if (tmp_str.append(',') || tmp_str.append(*res))
+ if (tmp_str.append(STRING_WITH_LEN(","), &my_charset_bin) || tmp_str.append(*res))
return &my_empty_string;
}
}
@@ -2699,8 +2701,12 @@ String* Item_func_export_set::val_str(String* str)
}
break;
case 3:
- sep_buf.set(STRING_WITH_LEN(","), default_charset());
- sep = &sep_buf;
+ {
+ /* errors is not checked - assume "," can always be converted */
+ uint errors;
+ sep_buf.copy(STRING_WITH_LEN(","), &my_charset_bin, collation.collation, &errors);
+ sep = &sep_buf;
+ }
break;
default:
DBUG_ASSERT(0); // cannot happen