Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
#1314214: MySQL driver does not support full UTF-8 (emojis, asian symbols, mathematical symbols) changed the default table collation for MySQL. When attempting to test beta upgrades in the Head 2 Head module, it was discovered that dumps generated *before* that change no longer load since they are created with the new utf8mb4 collation, rather than with their original collation.
Proposed resolution
Export collation with the table definition in the generated dump file.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#1 | db-dump-collation-2522120-01.patch | 1.68 KB | jhedstrom |
Comments
Comment #1
jhedstromComment #2
catchBumping to major. Any contrib or custom modules which need to go utf8 -> utf8mb or varchar -> varchar_ascii would be unable to test their upgrade paths if they want to upgrade from before the schema change was made until after during testing.
If core needs to make a collation change this would be critical, but it doesn't at the moment at least.
Comment #3
Fabianx CreditAttribution: Fabianx for Drupal Association commentedRTBC, I don't assume we can test this.
Comment #4
catchSo I think we probably could test this. Take a database dump with one collation (can be a test module db table). Then a hook_update_N() in that same test module to change the collation. Then either tricky asserts before and after to check the collation, or insert some characters that only work utf8 -> utf8mb or similar and confirm they get entered OK.
However, since this blocks the head2head testing issue which is going to give us excellent implicit test coverage of this, I would rather have good real-life implicit coverage aooner, than hold this up on test-framework-only explicit test coverage that will not be straightforward to write.
If someone feels like writing explicit coverage for this please open an issue and that's worth having though.
Committed/pushed to 8.0.x, thanks!