Azat
Azat

Reputation: 681

Collations in MySQL

There is a table with the following stucture:

Structure of table

Here are the data in this table:

Records in this table

Ok, let's try the following:

SELECT
LOWER(md5_upper_bin), 
LOWER(md5_upper_ge_ci), 
UPPER(md5_lower_bin),
UPPER(md5_lower_ge_ci) 
FROM qwew


The result is:

Result of experimental query

The question: why the postfix _bin have been ignored? According to MySQL manual, we can say that _bin affects to such functions like LOWER and UPPER too (and make them not working because binary-type collaction is used in these fields). But we've got another results in practice. Why?

Upvotes: 0

Views: 123

Answers (1)

rxmnnxfpvg
rxmnnxfpvg

Reputation: 30983

CHAR and VARCHAR store nonbinary strings, not binary strings. You have to change the actual column type to BINARY or VARBINARY for the _bin collation to affect UPPER and LOWER functions applied to data within them.

Upvotes: 2

Related Questions