diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-15 10:47:50 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-15 10:47:50 -0300 |
commit | 649390ac814ce5ea1e77b833ab5fe92dfcfe86d5 (patch) | |
tree | ac8b15ac65b08a492c256369b73e372f6568c7a4 /sql/item_strfunc.cc | |
parent | 06b8897e8e9a27b6ffc562af90153ab63f30e63e (diff) | |
parent | 8df20918d6751dc1eeb47ab722269dbd9d2da297 (diff) | |
download | mariadb-git-649390ac814ce5ea1e77b833ab5fe92dfcfe86d5.tar.gz |
Merge of mysql-trunk-bugfixing into mysql-trunk-merge.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 61febb01e93..851d0e07a7e 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -72,7 +72,12 @@ String *Item_str_ascii_func::val_str(String *str) DBUG_ASSERT(fixed == 1); if (!(collation.collation->state & MY_CS_NONASCII)) - return val_str_ascii(str); + { + String *res= val_str_ascii(str); + if (res) + res->set_charset(collation.collation); + return res; + } DBUG_ASSERT(str != &ascii_buf); @@ -242,7 +247,7 @@ void Item_func_sha::fix_length_and_dec() fix_length_and_charset(SHA1_HASH_SIZE * 2, default_charset()); } -String *Item_func_sha2::val_str(String *str) +String *Item_func_sha2::val_str_ascii(String *str) { DBUG_ASSERT(fixed == 1); #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) @@ -338,19 +343,19 @@ void Item_func_sha2::fix_length_and_dec() switch (sha_variant) { #ifndef OPENSSL_NO_SHA512 case 512: - max_length= SHA512_DIGEST_LENGTH*2; + fix_length_and_charset(SHA512_DIGEST_LENGTH * 2, default_charset()); break; case 384: - max_length= SHA384_DIGEST_LENGTH*2; + fix_length_and_charset(SHA384_DIGEST_LENGTH * 2, default_charset()); break; #endif #ifndef OPENSSL_NO_SHA256 case 256: case 0: // SHA-256 is the default - max_length= SHA256_DIGEST_LENGTH*2; + fix_length_and_charset(SHA256_DIGEST_LENGTH * 2, default_charset()); break; case 224: - max_length= SHA224_DIGEST_LENGTH*2; + fix_length_and_charset(SHA224_DIGEST_LENGTH * 2, default_charset()); break; #endif default: |