Review main Merged

86725[BUGFIX] Use platform specific doctrine/dbal schema comparators

Benjamin Franzke CR +2 V +2 Hard +228 −126 updated 11/04/24, 10:53

Commit message

The MySQL schema comparator is aware of the fact that a column's
character set is to be inherited from its containing table, when
`TYPO3_CONF_VARS.DB.Connections.{connection}.defaultTableOptions`
is not sets.

The TYPO3 comparator wrapper implementation effectively
disabled the upstream platform adjustments for MySQL (and sqlite,
which has an own comparator as well), which is now fixed
by using a decorator pattern instead of inheritance which does
not allow to pull in platform specific comparator code.

The table options comparison is no longer done in `compareTables`,
but applied as an additional step (as the different upstream comparator
implementations are not modifiable by inheritance).

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 3

Files 5

Review log 1317

  1. Benjamin Franzke uploaded patch set 1 10/24/24, 05:02

  2. core-ci voted on patch set 1 V -1 10/24/24, 05:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68503

  3. Benjamin Franzke uploaded patch set 2 V -1 10/24/24, 09:11

  4. core-ci voted on patch set 2 V -1 10/24/24, 09:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68518

  5. Benjamin Franzke uploaded patch set 3 V -1 10/24/24, 09:27

  6. core-ci voted on patch set 3 V +1 10/24/24, 09:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68522

  7. Benjamin Franzke uploaded patch set 4 V +1 10/24/24, 16:19

  8. Benjamin Franzke uploaded patch set 5 10/24/24, 16:20

  9. Benjamin Franzke commented on patch set 5 10/24/24, 16:21

    SchemaMigratorTest.php:63

    For the protocol: Has been tested to fail without the patch in https://review.typo3.org/c/Packages/TYPO3.CMS/+/86770/1 https://git.typo3.org/typo3/CI/cms/-/jobs/3919159 ``` There were 15 failures: 1) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::addNewColumns with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:283 2) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::changeExistingColumn with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:300 3) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::notNullWithoutDefaultValue with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:318 4) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::defaultNullWithoutNotNull with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:333 5) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::renameUnusedField with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:349 6) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::renameUnusedTable with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:365 7) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::dropUnusedField with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:381 8) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::dropUnusedTable with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:426 9) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::installPerformsOnlyAddAndCreateOperations with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:447 10) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::installDoesNotAddIndexOnChangedColumn with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:464 11) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::changeExistingIndex with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:478 12) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::installCanPerformChangeOperations with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:510 13) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::importStaticDataInsertsRecords with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:528 14) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::changeTableEngine with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:211 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:563 15) TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::mediumTextToLargeTextColumChangeAndRevertWorksAsExpected with data set #1 (true) Schema probably polluted by previous test, unclean operation: change /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:114 /builds/typo3/CI/cms/typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php:813 FAILURES! ```
  10. core-ci voted on patch set 5 V +1 10/24/24, 16:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68566

  11. Garvin Hicking commented on patch set 5 V +1 10/24/24, 21:23

    Can't comment on the code itself atm. But using this patch, my ddev installation (mysql:8.0) now no longer reports circular tries of a utf8mb4->"" mismatch. My settings.php: ``` 'DB' => [ 'Connections' => [ 'Default' => [ 'charset' => 'utf8mb4', 'driver' => 'mysqli', ], ], ], ``` My additional.php: ``` 'DB' => [ 'Connections' => [ 'Default' => [ 'charset' => 'utf8mb4', 'dbname' => 'db', 'driver' => 'mysqli', 'host' => 'db', 'password' => 'db', 'port' => '3306', 'user' => 'db', ], ], ], ```
  12. Stefan Bürk commented on patch set 5 CR -1 11/04/24, 08:49

    Reviewing ...
  13. Stefan Bürk commented on patch set 5 CR +1 V +1 11/04/24, 09:15

    Reply

    Done
  14. Garvin Hicking voted on patch set 5 CR +1 11/04/24, 09:26

  15. Benjamin Franzke voted on patch set 5 CR +2 V +2 11/04/24, 10:24

  16. Benni Mack voted on patch set 5 CR +1 11/04/24, 10:30

  17. Benjamin Franzke merged patch set 6 11/04/24, 10:53