mysqlhibernatecasemariadb

MariaDB / MySQL querys are case sensitive?


I just want to know if that querys are case sensitive or not. Are the same these querys?

SELECT * FROM Users WHERE login="john";
SELECT * FROM Users WHERE login="John";
SELECT * FROM Users WHERE login="JOHN";
SELECT * FROM Users WHERE login="jOHn";

I have tried that on my console and all of them worked, but I want to be sure of that if I would use Hibernate or anything else.

Thanks!


Solution

  • According to the MySQL docs,

    The default character set and collation are latin1 and latin1_swedish_ci, so nonbinary string comparisons are case insensitive by default

    As to the second part of you question - this SO answer shows you how to configure to have the searchers be case sensitive.