Bug #61609 lower with cp1256 charset
Submitted: 23 Jun 2011 14:51 Modified: 23 Jun 2011 16:46
Reporter: mahmoud krayem Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Charsets Severity:S2 (Serious)
Version:5.1.57, 5.1.59 OS:Any (win32, Mac OS X)
Assigned to: CPU Architecture:Any
Tags: UPPER/LOWER function doesn't work correctly

[23 Jun 2011 14:51] mahmoud krayem
Description:
when execute sql:
select lower(CONVERT('ABt' USING cp1256))
the result :
abT

and when sql :
select UPPER(CONVERT('abt' USING cp1256))
the result:
ABt

the problem just for chat "t"

How to repeat:
select lower(CONVERT('ABt' USING cp1256))
---------------------------
abT

select UPPER(CONVERT('abt' USING cp1256))
--------------------------
ABt
[23 Jun 2011 16:46] Valeriy Kravchuk
Thank you for the bug report. Verified just as described with recent mysql-5.1 on Mac OS X:

macbook-pro:5.1 openxs$ bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.1.59-debug Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select lower(CONVERT('ABt' USING cp1256))
    -> ;
+------------------------------------+
| lower(CONVERT('ABt' USING cp1256)) |
+------------------------------------+
| abT                                |
+------------------------------------+
1 row in set (0.07 sec)

Other character set (1251 for example) works properly:

mysql> select UPPER(CONVERT('abt' USING cp1256))
    -> ;
+------------------------------------+
| UPPER(CONVERT('abt' USING cp1256)) |
+------------------------------------+
| ABt                                |
+------------------------------------+
1 row in set (0.00 sec)

mysql> select lower(CONVERT('ABt' USING cp1251));
+------------------------------------+
| lower(CONVERT('ABt' USING cp1251)) |
+------------------------------------+
| abt                                |
+------------------------------------+
1 row in set (0.01 sec)

mysql> select UPPER(CONVERT('abt' USING cp1251));
+------------------------------------+
| UPPER(CONVERT('abt' USING cp1251)) |
+------------------------------------+
| ABT                                |
+------------------------------------+
1 row in set (0.00 sec)
[24 May 2012 13:44] Mohammad Lahlouh
Same problem with me using  5.5.20-55-log Percona Server (GPL), Release 24.1
[4 Jul 2021 18:31] Waheed Alsayer
How come this is ignored 10 years later