Review 12.4 Merged

83457[BUGFIX] Ensure `Comparator` knows the current platform

Stefan Bürk CR +2 V +2 Easy +15 −4 updated 03/19/24, 13:08

Commit message

Doctrine DBAL 3.x has been introduced into TYPO3 v12
with #96287 and raised over the time, adding the one
or other deprecation and dual code branches and some
compat layers.

The `\Doctrine\DBAL\Schema\Comparator::compareSchemas()`
for example is still static and instantiaces itself,
and therefore not properly handing over the platform.
The missing platform does not execute the new way of
using `AbstractPlatform::columnsEqual()`, but renders
the platform specific handlings useless - specially
added for MySQL based platforms, for example the
datbase type `TEXT` length check and comparision.

This change passes the platform down to the inner
`Comparator` instance to ensure that the platform
specific handling can work. To avoid the new way
using the `AbstractPlatform::columnsEqual()` which
introduces incompatible checks for now, that method
is overriden and the `diffColumn()` check used.

That allows the proper TEXT sub-type handling with
MySQL and MariaDB while supressing noise for now.

Note: This is also done currently in TYPO3 v13.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Developer Archriss +1
    • Garvin Hicking +1
    • Christophe Monard +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Developer Archriss +1
    • Garvin Hicking +1
    • Christophe Monard +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 1418

  1. Stefan Bürk uploaded patch set 1 03/13/24, 16:34

  2. Stefan Bürk uploaded patch set 2 03/13/24, 16:37

  3. core-ci voted on patch set 1 V +1 03/13/24, 16:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54493

  4. core-ci voted on patch set 2 V +1 03/13/24, 16:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54494

  5. core-ci commented on patch set 2 03/13/24, 16:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54496

  6. Stefan Bürk uploaded patch set 3 V +1 03/14/24, 10:49

  7. core-ci voted on patch set 3 V +1 03/14/24, 10:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54523

  8. Stefan Bürk commented on patch set 3 03/14/24, 10:57

    Note: Nightly with more database vendors testing was happy ;)
  9. Stefan Bürk voted on patch set 3 CR -1 03/14/24, 11:18

  10. Garvin Hicking commented on patch set 3 03/14/24, 11:19

    (verified working in DB analyzer with text changes, waiting for feedback on PermissionCheck platform injection neccessity to give a vote)
  11. Stefan Bürk voted on patch set 3 CR 0 03/14/24, 11:24

  12. Stefan Bürk commented on patch set 3 03/14/24, 11:27

    Reply

    Note: In main(v13) along with Doctrine DBAL 4 it was required to change the PermissionCheck and use the comparator directly there, but does not matter here for this change because of ... * v12 does not use it directly in PermissionCheck * v13 with Doctrine DBAL 4 uses `compareSchemas()`, but the dbal deprecation layer from static to non-static is not included and no longer creating a instance - which means the platform is set and not missed. That are the points why only v12 is target by this issue, and the fix needs to go only into v12.
  13. Garvin Hicking voted on patch set 3 CR +1 V +1 03/14/24, 11:27

  14. Christophe Monard commented on patch set 3 CR +1 V +1 03/15/24, 08:16

    Work on v12 instance for me. Thanks
  15. Christian Kuhn voted on patch set 3 CR +1 V +1 03/19/24, 12:25

  16. Developer Archriss voted on patch set 3 CR +1 V +1 03/19/24, 12:46

  17. Stefan Bürk voted on patch set 3 CR +2 V +2 03/19/24, 13:08

  18. Stefan Bürk merged patch set 4 03/19/24, 13:08