Bug #8644 make the cp1250_czech_cs act like latin2_czech_cs
Submitted: 21 Feb 2005 10:39 Modified: 9 Oct 2008 8:09
Reporter: Roman Porizka Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Charsets Severity:S4 (Feature request)
Version:4.1.X, 5.1 OS:Linux (any)
Assigned to: Assigned Account CPU Architecture:Any

[21 Feb 2005 10:39] Roman Porizka
Description:
Hello,
there is difference between collation cp1250_czech_cs and latin2_czech_cs. In my opinion, latin2_czech_cs sorts czech words more naturally, then it does cp1250_czech_cs.

Thanks
Roman Porizka 

How to repeat:
mysql> create table bug6610 (c char(10)) character set cp1250 collate
cp1250_czech_cs;
Query OK, 0 rows affected (0.06 sec)

mysql> insert into bug6610
values("s"),("S"),("sa"),("Sa"),("so"),("So"),("SO");
Query OK, 7 rows affected (0.00 sec)
Records: 7  Duplicates: 0  Warnings: 0

mysql> select * from bug6610 order by c;
+------+
| c    |
+------+
| S    |
| s    |
| Sa   |
| sa   |
| SO   |
| So   |
| so   |
+------+
7 rows in set (0.00 sec)

mysql> drop table bug6610;
Query OK, 0 rows affected (0.01 sec)

mysql> create table bug6610 (c char(10)) character set latin2 collate
latin2_czech_cs;
Query OK, 0 rows affected (0.03 sec)

mysql> insert into bug6610
values("s"),("S"),("sa"),("Sa"),("so"),("So"),("SO");
Query OK, 7 rows affected (0.00 sec)
Records: 7  Duplicates: 0  Warnings: 0

mysql> select * from bug6610 order by c;
+------+
| c    |
+------+
| s    |
| S    |
| sa   |
| Sa   |
| so   |
| So   |
| SO   |
+------+
7 rows in set (0.01 sec)
[9 Oct 2008 8:09] Susanne Ebrecht
Many thanks for writing a feature request.

I think this is a bug.

Here is my test case:

Environment encoding: UTF8

set names utf8;

create table t_latin2(v varchar(100))default charset=latin2;
create table t_1250(v varchar(100))default charset=cp1250;

insert into t_latin2
values
('a'),('b'),('c'),('A'),('B'),('C'),('d'),('e'),('f'),('D'),('E'),('F'),
('g'),('h'),('i'),('G'),('H'),('I'),('j'),('k'),('l'),('J'),('K'),('L'),
('m'),('n'),('o'),('M'),('N'),('O'),('p'),('q'),('r'),('P'),('Q'),('R'),
('s'),('t'),('u'),('S'),('T'),('U'),('v'),('w'),('x'),('V'),('W'),('X'),
('y'),('z'),('Y'),('Z'),('á'),('Á'),('ä'),('Ä'),('č'),('Č'),('ď'),('Ď'),
('é'),('É'),('ě'),('Ě'),('í'),('Í'),('ĺ'),('Ĺ'),('ľ'),('Ľ'),('ň'),('Ň'),
('ó'),('Ó'),('ö'),('Ö'),('ř'),('Ř'),('š'),('Š'),('ť'),('Ť'),('ú'),('Ú'),
('ů'),('Ů'),('ü'),('Ü'),('ý'),('Ý'),('ž'),('Ž'),('sa'),('Sa'),('So'),('SO'),('so'),('ch'),('CH');

insert into t_1250
values
('a'),('b'),('c'),('A'),('B'),('C'),('d'),('e'),('f'),('D'),('E'),('F'),
('g'),('h'),('i'),('G'),('H'),('I'),('j'),('k'),('l'),('J'),('K'),('L'),
('m'),('n'),('o'),('M'),('N'),('O'),('p'),('q'),('r'),('P'),('Q'),('R'),
('s'),('t'),('u'),('S'),('T'),('U'),('v'),('w'),('x'),('V'),('W'),('X'),
('y'),('z'),('Y'),('Z'),('á'),('Á'),('ä'),('Ä'),('č'),('Č'),('ď'),('Ď'),
('é'),('É'),('ě'),('Ě'),('í'),('Í'),('ĺ'),('Ĺ'),('ľ'),('Ľ'),('ň'),('Ň'),
('ó'),('Ó'),('ö'),('Ö'),('ř'),('Ř'),('š'),('Š'),('ť'),('Ť'),('ú'),('Ú'),
('ů'),('Ů'),('ü'),('Ü'),('ý'),('Ý'),('ž'),('Ž'),('sa'),('Sa'),('So'),('SO'),('so'),('ch'),('CH');

SELECT * FROM t_latin2 ORDER BY v COLLATE latin2_czech_cs;

SELECT * FROM t_1250 ORDER BY v COLLATE cp1250_czech_cs;

Result:
mysql> SELECT * FROM t_1250 ORDER BY v COLLATE cp1250_czech_cs;
+------+
| v    |
+------+
| A    | 
| a    | 
| Á   | 
| á   | 
| Ä   | 
| ä   | 
...
| W    | 
| w    | 
| X    | 
| x    | 
| Y    | 
| y    | 
| Ý   | 
| ý   | 
| Z    | 
| z    | 
| Ž   | 
| ž   | 
+------+

mysql> SELECT * FROM t_latin2 ORDER BY v COLLATE latin2_czech_cs;
+------+
| v    |
+------+
| a    | 
| A    | 
| á   | 
| Á   | 
| ä   | 
| Ä   | 
...
| w    | 
| W    | 
| x    | 
| X    | 
| y    | 
| Y    | 
| ý   | 
| Ý   | 
| z    | 
| Z    | 
| ž   | 
| Ž   | 
+------+

As you can see:
cp1250_czech_cs sorts first capital letter then lower case letter and latin2_czech_cs sorts capital/lowercase vise versa.

Verified by using actual MySQL 5.1 bzr tree.