Review main Merged

51928[BUGFIX] SchemaMigrator: Don't add indexes on changed columns

Thomas Hohn CR +2 V +2 Normal +57 −3 updated 03/04/17, 01:35

Commit message

Adding or changing an index on MySQL could sometimes fail due
to a dependency between the index definition and the column types.
On MySQL indexes on TEXT/BLOB types might require defining a
prefix length so that the index does not exceed storage limits.

Implement a check when migrating the database in a mode that
only adds fields and indexes such that added indexes do not touch
columns that require changes.

Also update the detection of required database changes in the
upgrade wizard so it does not get stuck on database changes
which will not be performed in that phase.

Review

  • Code review CR +2
    • Morton Jonuschat +2
    • Markus Klein +1
  • Verified V +2
    • Morton Jonuschat +2
    • Johannes Kasberger +1
    • TYPO3com +1 CI

Issues 2

Files 4

Review log 2229

Show 34 earlier messages
  1. Thomas Hohn uploaded patch set 1 03/02/17, 13:29

  2. TYPO3com voted on patch set 1 V -1 03/02/17, 13:36 Completed build in 07m 36s on Thu, 2 Mar, 02:36 PM Test Summary: 1 of 56397 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8839

  3. Thomas Hohn commented on patch set 1 03/02/17, 13:45

    I still need to look at the test - but please test
  4. Josef Glatz commented on patch set 1 03/02/17, 14:14

    will test it in the evening! Thx Thomas so far!
  1. Morton Jonuschat commented on patch set 1 CR -1 03/02/17, 14:53

    This seems to be a different take on the change I2c4b17076812fa9602f73cbb5f3418b88e3af41d I am not able to reproduce either error condition, it must be something environment (i.e. DB version) related that needs to be investigated further. My gut feeling is that this approach (performing any and all column changes) is overly broad and there could be a better approach if the source of the problem is known.

    ConnectionMigrator.php:209

    Can be reduced to if(!empty($schemaDiff->changedTables[$key]->addedIndexes) || !empty(...))
  2. Morton Jonuschat commented on patch set 1 03/02/17, 15:05

    I think we need to figure out why under some circumstances this is detected as an ADD that ends up in addedIndexes instead of a CHANGE thats put into changedIndexes. The index should exist (in a slightly different configuration) and as such be properly detected. Having it end up in the ADD section might have the added problem that it would require a DROP first (as it already exists). This approach could trade one problem for the next that the index can not be created due to a name conflict.
  3. Thomas Hohn commented on patch set 1 03/02/17, 15:54

    See the ticket for the newest findings
  4. Morton Jonuschat commented on patch set 1 03/02/17, 15:58

    There's nothing new in the ticket. The first part is the same text as for the other issue and the second one is a different table with the same problem. I don't see anything new there. Thanks to Markus we only confirmed that the database is clean, which makes it even harder to figure out the proper solution because these changes should not be detected as add operations.
  5. Thomas Hohn commented on patch set 1 03/02/17, 16:07

    Now there is :-)
  6. Thomas Hohn commented on patch set 1 CR -1 03/02/17, 20:03

    Morton - I can have a look at what we discussed if you want?
  7. Thomas Hohn uploaded patch set 2 03/02/17, 21:05

  8. Thomas Hohn uploaded patch set 3 03/02/17, 21:08

  9. TYPO3com voted on patch set 2 V -1 03/02/17, 21:14 Completed build in 08m 37s on Thu, 2 Mar, 10:14 PM Test Summary: 56397 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8843

  10. TYPO3com voted on patch set 3 V +1 03/02/17, 21:17 Completed build in 08m 48s on Thu, 2 Mar, 10:17 PM Test Summary: 56397 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8844

  11. Morton Jonuschat commented on patch set 3 CR -1 03/03/17, 03:04

    On it
  12. Morton Jonuschat uploaded patch set 4 03/03/17, 03:24

  13. TYPO3com voted on patch set 4 V -1 03/03/17, 03:32 Completed build in 08m 17s on Fri, 3 Mar, 04:32 AM Test Summary: 56398 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8846

  14. Morton Jonuschat uploaded patch set 5 03/03/17, 03:34

  15. TYPO3com voted on patch set 5 V +1 03/03/17, 03:43 Completed build in 09m 09s on Fri, 3 Mar, 04:43 AM Test Summary: 56398 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8847

  16. Thomas Hohn voted on patch set 5 CR +1 V +1 03/03/17, 10:44

  17. Markus Klein updated the commit message in patch set 6 03/03/17, 12:10

  18. Markus Klein commented on patch set 6 03/03/17, 12:13

    ConnectionMigrator.php:210

    we use !empty() for this for consistency and performance
  19. TYPO3com voted on patch set 6 V +1 03/03/17, 12:19 Completed build in 08m 43s on Fri, 3 Mar, 01:19 PM Test Summary: 56398 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8856

  20. Thomas Hohn uploaded patch set 7 03/03/17, 12:41

  21. Markus Klein voted on patch set 7 CR +1 03/03/17, 12:45

  22. TYPO3com voted on patch set 7 V +1 03/03/17, 12:48 Completed build in 07m 00s on Fri, 3 Mar, 01:48 PM Test Summary: 56398 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8857

  23. Johannes Kasberger commented on patch set 7 V +1 03/03/17, 16:00

    I tried the upgrade wizards with the new patch and now I get no errors. Is it possible to extract the for loops from InitialDatabaseSchemaUpdate and ConnectionMigrator to a single location? The loops are the same (except for the unset).
  24. Morton Jonuschat commented on patch set 7 CR +2 V +2 03/04/17, 01:35

    No, not easily since it would be a public interface on ConnectionMigrator then, and that no better than a few lines of code duplication do have different actions as well.
  25. Gerrit merged patch set 7 03/04/17, 01:35