stevebot stevebot - 1 month ago 12
Java Question

H2 In memory DB treating ORDER BY differently in MySQL mode

I have a query that does an

ORDER BY
on a VARCHAR column that contains email addresses.

If I hit my physical MySQL db, it ignores case in the
ORDER BY
. However, my h2 in-memory DB is respecting case. It is set to MySQL mode.

Anyone know why this is?

Answer

Case sensitivity when evaluating strings in databases is determined by the collation.

Check the collation handling on H2: http://www.h2database.com/html/grammar.html#set_collation

Comments