Bug #31439 _cs collations are missing
Submitted: 8 Oct 2007 6:26 Modified: 15 Oct 2007 11:07
Reporter: Maciej Pilichowski Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Charsets Severity:S3 (Non-critical)
Version:5.0.45 OS:Linux
Assigned to: Alexander Barkov CPU Architecture:Any

[8 Oct 2007 6:26] Maciej Pilichowski
Description:
The original report is here:
http://bugs.mysql.com/bug.php?id=31351
but thanks to "intelligent" comments about other things this report was practically "hijacked". So...

Description:
Take a look at MySql own doc:
http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html

And here is the bug -- there are no *_cs collations. I checked utf8_general_cs and utf8_polish_cs for example. There are no *_bin collations either.

I am unable to group, search in case sensitive manner. And just to make sure somebody would not crash into this report this time, I don't care if A>a or A>b or whatever. My only concern is this -- A=a so far and I would like to get A!=a.

I am not wishing extra _cs collation of some sort, I am just saying -- provide collations described in MySQL documentation. This is not new feature.

How to repeat:
How to repeat:
Simply run mysql examples.

Suggested fix:
Suggested fix:
Provide case sensitive collations.
[8 Oct 2007 15:32] MySQL Verification Team
Thank you for the bug report.
[15 Oct 2007 8:47] Alexander Barkov
>I am unable to group, search in case sensitive manner.
> And just to make sure somebody
> would not crash into this report this time,
> I don't care if A>a or A>b or whatever.
> My only concern is this -- A=a so far and I would like to get A!=a.

MySQL does provide _bin collation for EVERY character set.
This is an example with character set utf8:

mysql> create table t1 (a varchar(10) character set utf8 collate utf8_bin);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into t1 values ('A'),('a'),('B'),('b'),('C'),('c');
Query OK, 6 rows affected (0.00 sec)
Records: 6  Duplicates: 0  Warnings: 0

mysql> select * from t1 where a='a';
+------+
| a    |
+------+
| a    |
+------+
1 row in set (0.01 sec)

mysql> select * from t1 where a='A';
+------+
| a    |
+------+
| A    |
+------+
1 row in set (0.00 sec)

mysql> select a, count(*) from t1 group by a;
+------+----------+
| a    | count(*) |
+------+----------+
| A    |        1 |
| B    |        1 |
| C    |        1 |
| a    |        1 |
| b    |        1 |
| c    |        1 |
+------+----------+
6 rows in set (0.00 sec)

I guess in a mistake you was trying to use COLLATE utf8_general_bin
and COLLATE utf8_polish_bin. The collation name is utf8_bin.

You can find the list of collations using "SHOW COLLATION".

Closing as "Not a bug".
[15 Oct 2007 11:07] Maciej Pilichowski
Alexander, thank you! It works.

However, I think it is very misleading -- you have utf8_polish_ci but on the other hand you have ut8_bin --> adding just an alias would be great (utf8_polish_cs in this example).