diff options
author | Alexander Barkov <bar@mysql.com> | 2010-07-07 10:38:11 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mysql.com> | 2010-07-07 10:38:11 +0400 |
commit | 00e86d01a72c539b915e07f4b7b8fe218433fd60 (patch) | |
tree | e872e3c1b1d8935b62347e5c4fd395d237b68567 /mysql-test/r/func_digest.result | |
parent | 72bb9b7acbacc20172512184dc2724fccbc7a741 (diff) | |
download | mariadb-git-00e86d01a72c539b915e07f4b7b8fe218433fd60.tar.gz |
Bug#54661 sha2() returns BINARY result
Problem: sha2() reported its result as BINARY
Fix:
- Inheriting Item_func_sha2 from Item_str_ascii_func
- Setting max_length via fix_length_and_charset()
instead of direct assignment.
- Adding tests
Diffstat (limited to 'mysql-test/r/func_digest.result')
-rw-r--r-- | mysql-test/r/func_digest.result | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/r/func_digest.result b/mysql-test/r/func_digest.result index ff3a4dcf79a..095b69363ce 100644 --- a/mysql-test/r/func_digest.result +++ b/mysql-test/r/func_digest.result @@ -1405,3 +1405,24 @@ LENGTH(SHA2( 'size', 384 )) / 2 * 8 = 384 SELECT LENGTH(SHA2( 'computed', 512 )) / 2 * 8 = 512; LENGTH(SHA2( 'computed', 512 )) / 2 * 8 = 512 1 +# +# Bug#54661 sha2() returns BINARY result +# +SET NAMES binary; +SELECT sha2('1',224); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def sha2('1',224) 253 56 56 Y 128 31 63 +sha2('1',224) +e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178 +SET NAMES utf8; +SELECT sha2('1',224); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def sha2('1',224) 253 168 56 Y 0 31 33 +sha2('1',224) +e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178 +SET NAMES latin1; +SELECT sha2('1',224); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def sha2('1',224) 253 56 56 Y 0 31 8 +sha2('1',224) +e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178 |