Bug #4001 LCASE(), LOWER(), UPCASE(), UPPER() don't work on BINARY fields
Submitted: 4 Jun 2004 11:55 Modified: 4 Jun 2004 17:25
Reporter: Antonio Bonifati Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.1-alpha OS:FreeBSD (FreeBSD)
Assigned to: Dean Ellis CPU Architecture:Any

[4 Jun 2004 11:55] Antonio Bonifati
Description:
I noticed that the string functions LCASE(str), LOWER(str),
UCASE(str) and UPPER(str) don't work on VARCHAR BINARY fields
and they return the field value unchanged.

I'm not sure if this is a "feature" or a bug, but it prevented
the title search from working in PhpWiki <http://phpwiki.sourceforge.net>

Can someone please try this
under 4.1.2 alpha and tell me if it has been fixed?

How to repeat:
mysql> CREATE TABLE test (
    ->   name VARCHAR(30) BINARY
    -> );
Query OK, 0 rows affected (0.46 sec)

mysql> INSERT INTO test VALUES('MySQL');
Query OK, 1 row affected (0.05 sec)

mysql> SELECT LOWER(name) FROM test;
+-------------+
| LOWER(name) |
+-------------+
| MySQL       |
+-------------+
1 row in set (0.00 sec)
[4 Jun 2004 17:25] Dean Ellis
Yes, this was corrected in 4.1.2.  Unless dealing with actual binary columns (BINARY, VARBINARY, BLOB) UPPER/LOWER will change case.