-
-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zc_install
can result in "mixed collations"
#6664
Comments
Upgrading a zc157 database with a |
We could go various directions with this. But before considering that, I'll point out that the whole reason for Thus ... we could begin with documenting that people should choose the mb4 variant wherever possible. And we could add an alert in zc_install recommending that they update the database's default collation to a matching variant. |
As for the IIRC that's why zc_install leans toward |
IMO, zc_install should:
|
As I've jumped around hostings over the years, most if not all defaults were latin1, no doubt from hosting inertia and not any conscious decision. Assuming that most if not all users who do an install (implying a new start) are novices and would not know a collation from a bar of soap, would it not be better to ignore the db default and force utf-8 charset/collations from day one? |
Agreed on the 'install', it's just a matter of zc_install (a) finding the most appropriate utf8-type collation, (b) setting the database's base collation to that and (c) registering either 'utf8' or 'utf8mb4' as the DB_CHARSET (based on the code's findings). |
I have a strong reluctance to carry latin1 forward on upgrades. I think we should HALT the upgrade and refuse to proceed if latin1 is found. Forcing them to upgrade their database content first. Otherwise if we just accept their latin1 data and try to babysit it forward into the future, support will be difficult because everything in the world uses utf8mb4 (or in some cases the lesser mb3, albeit that has its problems, and mb4 should be used). So, yes, I'd agree with point 2, insomuch as if latin1 is detected, we just tell them that and so go grab the conversion utility and run it. There's the added complication that most end-users do NOT have the ability to ALTER DATABASE and change the database's defaults. They "might" have a switch in their cPanel/whatever, but most likely need to ask tech support to change it for them. Therefore zc_install cannot be counted on to change it, and it's a false sense of security to offer it when the only place it would be able to do it is on dev's offline localhost databases, not on live servers. If the user doesn't get that default collation/charset updated, then no matter how hard we try to prevent mixed collations, we can't. People can create new tables and new columns without specifying a collation, and in that case the database's default will be used. And if that's still Better to HALT and force conversion, and then carry on using meaningful defaults as it does now. |
utf8_general_ci
collation. Thezc_install
process completed successfully, but all tables/table-fields were created withutf8mb4_general_ci
collation.configure.php
files, since that was introduced in zc150). The database's base collation islatin_general_ci
and all tables added by thezc_install
process useutf8mb4_general_ci
collation. The 'DB_CHARSET' is successfully added to the updatedconfigure.php
files, with a value of 'utf8mb4'.This will lead to potential collation-mismatch errors in the future, since additional tables added will inherit the database's default collation, which is not necessary reflective of the 'DB_CHARSET' value.
The text was updated successfully, but these errors were encountered: