Review main Merged

94605[BUGFIX] Allow database names containing a dot in schema migration

Georg Ringer CR +2 V +2 Easy +9 −3 updated 08/31/26, 07:52

Commit message

The database analyzer / compare tool aborts with a misleading
"TableAlreadyExists" exception when the configured database name
contains a dot, e.g. "db.dot" or "a.b.c":

  The table with name "db.dot" already exists.

ConnectionMigrator::buildExpectedSchemaDefinitions() set the raw
database name as the default namespace of the expected schema. Doctrine
DBAL then prepends that namespace to every table name and parses the
result as a qualified "<namespace>.<name>" identifier, splitting it at
the dot. As a consequence every table collapses to the very same key
(the database name) and adding the second table fails.

The introspected ("from") schema is not affected because Doctrine uses
the current schema name as default namespace, which is null for
platforms without schema support (MySQL, MariaDB, SQLite).

The expected schema now derives its default namespace the same way, so
both schemas stay comparable and dotted database names no longer break
the schema migration. The defaultTableOptions handling is left
untouched on purpose.

Review

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

Issues 1

Files 1

Review log 1013

  1. Georg Ringer uploaded patch set 1 06/26/26, 17:22

  2. Georg Ringer commented on patch set 1 06/26/26, 17:22

    This change is ready for review.
  3. core-ci voted on patch set 1 V -1 06/26/26, 17:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103956

  4. core-ci voted on patch set 1 V +1 06/30/26, 18:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103956

  5. Stefan Bürk commented on patch set 1 CR -1 08/02/26, 17:06

    Thanks for tracking this down - the fix is correct: it removes the default-namespace asymmetry between the expected and the introspected schema (the "to" side used the raw database name, the "from" side uses getCurrentSchemaName(), which is null on MySQL/MariaDB/SQLite), so a dotted database name no longer collapses every table onto the same key.
    One point on the Releases footer: it currently targets "main, 14.3", but this is a v13 regression. The reporter notes it did not happen on v12, and it was confirmed on 13.4.22 in the issue (#108028). Since the change is behaviour-preserving on normal database names, it should be safe to backport. v13 uses currently the same doctrine/dbal version anyway, so I go to extend Releases to "main, 14.3, 13.4".

    ConnectionMigrator.php:321

    This creates now a new schema manager here, while `buildSchemaDiff()`, the only place calling this method already have one and I'd like that we pass the instance instead of creating a new one. `->getName()`: a short comment on why this indirection is needed (getCurrentSchemaName() is protected) would help the next reader not "simplify" it back into the bug.
  6. Stefan Bürk uploaded patch set 2 CR -1 V +1 08/02/26, 17:15

  7. Stefan Bürk commented on patch set 2 08/02/26, 17:18

    Reply

    Done

    ConnectionMigrator.php:321 Reply

    Done
  8. core-ci voted on patch set 2 V +1 08/02/26, 17:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105853

  9. Stefan Bürk voted on patch set 2 CR +1 V +1 08/02/26, 17:25

  10. Georg Ringer voted on patch set 2 CR +1 V +1 08/05/26, 09:22

  11. Garvin Hicking voted on patch set 2 CR +1 V +1 08/27/26, 16:06

  12. Stefan Bürk voted on patch set 2 CR +2 V +2 08/31/26, 07:27

  13. Stefan Bürk merged patch set 3 08/31/26, 07:52