-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Move to kaliop_migration table to utf8mb4? #176
Comments
Indeed. How does ez deal with backwards compatibility about that? Is there any issue at all? |
Don't think it deals with it at all. At least for platform v2.3 all database versions in the requirements (https://doc.ezplatform.com/en/2.3/getting_started/requirements/) support utfmb4. If you do have run it on an ancient version you'd have to convert it manually. utf8mb4 was added in MySQL 5.5 back in 2010: https://dev.mysql.com/doc/relnotes/mysql/5.5/en/news-5-5-3.html |
Uhm... preliminary analysis tells me that the component I use to create kaliop migrations own tables (which is the Schema Manager from Doctrine) does not have explicit support for managing the character set :-( I could maybe add a sql migration file to the mig. bundle, which would only affect mysql-based databases... at the same time I am a bit loath to do that, as it might break stuff for anyone who's doing joins on those tables. Any suggestion on how to tackle this is welcome ;-) |
Have to admin I'm not well versed in Doctrine and its migration system, but I did some googling... From a bit of research it seems possible to pass a |
Btw: there is an interesting comparison of how performances (for selects) are affected by choice of character set, related to the version of MySql in use at: https://www.percona.com/blog/2019/02/27/charset-and-collation-settings-impact-on-mysql-performance/ |
@omh my main concerns would still be: I would have hoped that point B was naturally the case - at least it happened on the databases which I use, which are set for a default of utf8_general_ci. Do you confirm that it did not happen for you? And if it did not, what are the default db settings that you have for collations? |
About Doctrine not specifying a default charset/collation (or picking up the default one from the current schema): it seems that this is not the case: https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L486. Otoh we should be able to retrieve it with a couple of queries: |
Lots of MySQL installations are still This isn't hugely important as you're unlikely to have paths or error messages with emojis, but it's nice to be consistent. Not sure how to actually make it happen though... |
A 'hackish' but 'safe' solution could be the following:
We could make step 3 go further and change the mig tables encoding to the same used by eZ even for non-utf8mb4. Ideally we could scan for more/other tables than ezcontentobject of course, but in my experience I have seen many ez dbs have erratic/inconistent charsets in their table definitions... |
Doing some experiments... good news: it seems that we can simply call bad news: doing so makes mysql crap itself with error Sadly, working around this limitation is not trivial:
|
further bad news: Doctrine does support specifying Index Length for Mysql but:
|
Update: managed to overcome the index-length limitation with some too-smart-for-its-own-good code - hopefully that will work for all mysql versions... (see 15cf8e8) |
Just chiming in from the side line here: would switching the PK to the |
'md5 == md5(file contents)', so unfortunately that won't do - we might have many migrations with the same definition. |
Travis test are good now. |
While not technically necessary it would be nice if the
kaliop_migration
table also used utf8mb4 to be consistent with the rest of eZ.The text was updated successfully, but these errors were encountered: