MySQL Comparison with Binary Collation and Binary Strings

according to mysql certification guide, comparisons between binary collation and binary strings are different because comparisons in binary collation are done per character against every byte in binary strings. but what difference does it make?

+2


source to share


1 answer


you can't set sorting on binary data ('01100110101011') - what's the point? So - not sorting for any binary strings: BINARY, VARBINARY, TINYBLOB, MEDIUMBLOB, BLOB. Comparisons for these data types are always done byte by byte.

The default ordering for MySQL columns is case insensitive. This is the usual sorting of words, for example: latin_swedish_ci, utf8_general_ci (ci is case insensitive). This way your search terms are not case sensitive.



You can use binary collation to provide case sensitive searches. There are other differences as well:

case-senhsitivity

0


source







All Articles