Off topic: mySQL collations

toolbook at toolbook at
Mon Jul 26 09:13:05 EDT 2021



I am testing to migrate a mySQL database from 5.7 to 8. I am using PHP code
between my LiveCode program and the db. This PHP code is pretty old and was
actually written by somebody else.

Since mySQL 8 deprecated some charactersets and collations, the following
query in my PHP is not anymore allowed with mySQL 8 because of the
deprecated collation:


$query = "(SELECT * FROM lizenzen WHERE seriennr COLLATE latin1_general_ci
='$serial' COLLATE latin1_general_ci LIMIT 1) UNION (SELECT * FROM lizenz2
WHERE seriennr ='$serial' LIMIT 1)";


I now can change the collation, but my question is, do you see any reason
for the collation statement in this select statement at all? The content of
the column "seriennr" is unique and doesn't contains any accented or other
special chars and there is just one record selected in one of the two tables
with the requested seriennr. I am not good in mySQL, but I don't see any use
of the collation. Couldn't I just delete the two collation statements for
the same result or do they have a function I don't see?









More information about the use-livecode mailing list