Review 13.4 Merged

93629[BUGFIX] Respect DBAL `serverVersion` in `getPlatformServerVersion()`

Stefan Bürk CR +2 V +2 Normal +49 −3 updated 04/11/26, 18:22

Commit message

Doctrine DBAL does a really good job to determine the database
vendor and version from the database system itself. Still, this
can fail in some setups, for example in case a SQL proxy is used
which may report a custom version and lead to wrong database
platform detection within Doctrine DBAL consumers.

With `doctrine/dbal:^4` the `ServerVersionProvider` interface
has been introduced, which every connection for all supported
databases implement.

Additionally a `StaticServerVersionProvider` has been added,
which can be used to resolve the server version based on config
values like `serverVersion` on the database connection, or for
the primary connection of a master/slave setup.

That is handled in DBAL's `getDatabasePlatform()` method to set
the suitable platform class based on this server
information.

Since TYPO3 v13, the method `Connection->getPlatformServerVersion()`
is utilized as a wrapper for this DBAL method, whenever version
information is utilized. It returned the `real` reported version
of the SQL connection, ignoring any configured values.

This change streamlines `getPlatformServerVersion()` by making
use of the `ServerVersionProvider` logic just like it is performed
by Doctrine DBAL itself in `getDatabasePlatform()`.

A wrapper method `typo3_getServerVersionProvider()` is utiliezd for
this, with the goal to contribute that to upstream `doctrine/dbal`
and be able to remove it in the future from TYPO3 Core.

This patch now prevents displaying different version information for
the SQL connection, which could lead to confusion for system
maintainers.

A future follow-up patch may deal with displaying both the
"native" and "configured" sever version information.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 1

Files 2

Review log 34

  1. Stefan Bürk commented on patch set 1 04/11/26, 18:09

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 04/11/26, 18:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99981

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 04/11/26, 18:22

  4. Stefan Bürk merged patch set 2 04/11/26, 18:22