Issue Bug Closed

#110241Newer Doctrine platform classes are not elevated

Stefan Bürk 07/20/26, 19:04 updated 08/11/26, 08:51

Description

CustomPlatformDriverDecorator replaces the Doctrine platform instance with the
TYPO3 counterpart, which carries schema handling the core depends on, for
example the type aware column comment handling and the table engine and row
format options for ALTER TABLE.

The mapping matches on the concrete platform class:

  return match ($platform::class) {
      DoctrineMariaDBPlatform::class => new Typo3MariaDBPlatform(),
      ...
  };

That only covers platforms a dedicated TYPO3 class exists for. Doctrine adds
platform classes for newer server versions over time, and those fall through to
the default arm and are passed through unelevated, silently losing the TYPO3
behaviour of their parent platform.

Two platform classes are affected today.

MariaDB 11.7 and newer

Doctrine selects MariaDB110700Platform from MariaDB 11.7 on. Without elevation
the MySQLCompatibleAlterTablePlatformAwareTrait is missing, so the engine and
row format options are not appended to the generated ALTER TABLE statements.

Measured on the full core/Tests/Functional/Database suite, 400 tests:

  MariaDB 11.4   OK, 0 failures         (elevates correctly)
  MariaDB 11.7   3 errors, 6 failures
  MariaDB 11.8   2 errors, 6 failures

The engine and row format statement is absent from getAlterTableSQL() output on
11.8, while it is present on 11.4. Such a migration is therefore never emitted
and cannot be applied, and the schema analyzer keeps offering it.

MariaDB 11.8 is a long term release, so this affects a version intended for
production use.

PostgreSQL 12 and newer

Doctrine selects PostgreSQL120Platform from PostgreSQL 12 on, which is likewise
not elevated. This one is latent: the only thing Typo3PostgreSQLPlatform adds is
GetColumnDeclarationSQLCommentTypeAwareTrait, and that trait’s
typeRequiresCommentHint() map has entries for SQLite, MariaDB and MySQL only.
With no PostgreSQL entry the trait is a no-op there, so nothing observable
changes today.

It is included here because it is the same defect with the same fix, and because
the moment a PostgreSQL entry is added to that map it would become a real one.
It should not be counted as user facing impact on its own.

Note on reproducibility

MariaDB 11.7 and 11.8 could not be selected in runTests.sh before #110240, so
this was not reachable locally or in CI. That issue is the prerequisite for
working on this one.

Suggested fix

Add the missing TYPO3 counterparts, MariaDB110700Platform and
PostgreSQL120Platform, mirroring their Doctrine parents, and register them in
the decorator above the class they inherit from.

Matching on instanceof instead of the concrete class was considered and rejected:
it would make every future Doctrine platform silently inherit the behaviour of
its closest known ancestor, which hides exactly this kind of gap instead of
surfacing it.

Reviews 5

History 36

  1. Stefan Bürk commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-07-21T08:20:09+00:00" > 07/21/26, 08:20 </span>

    Applied in changeset commit:8aa7702b0579178149a45815f7a29e1d48499316.