Bug #3717 ENCODE returns a character string, not a binary string
Submitted: 11 May 2004 18:29 Modified: 28 Jun 2004 13:58
Reporter: Alexander Barkov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.2 OS:Any (all)
Assigned to: Alexander Barkov CPU Architecture:Any

[11 May 2004 18:29] Alexander Barkov
Description:
Paul DuBois wrote:

The manual says:

`ENCODE(str,pass_str)'
     Encrypt `str' using `pass_str' as the password.  To decrypt the
     result, use `DECODE()'.

     The result is a binary string of the same length as `string'.  If
     you want to save it in a column, use a `BLOB' column type.

How to repeat:
However, what I observe is this:

mysql> SELECT CHARSET(ENCODE('a','b'));
+--------------------------+
| CHARSET(ENCODE('a','b')) |
+--------------------------+
| latin1                   |
+--------------------------+
1 row in set (0.02 sec)

mysql> SELECT COLLATION(ENCODE('a','b'));
+----------------------------+
| COLLATION(ENCODE('a','b')) |
+----------------------------+
| latin1_swedish_ci          |
+----------------------------+
1 row in set (0.00 sec)

I don't see anything "binary" about the result from ENCODE().
What am I missing?