Review 14.3 Merged

95553[BUGFIX] Add SQLite JSON and UUID column declarations

Stefan Bürk CR +2 V +2 Normal +193 −11 updated 09/02/26, 10:24

Commit message

Adding a column whose Doctrine type needs a `(DC2Type:<name>)` type
hint - `json` or `uuid` - to an existing table fails on SQLite:

  SQLSTATE[HY000]: General error: 1 error in table a_test_table
  after add column: incomplete input

SQLite renders column comments as `--<comment>` line comments. In
the simplified `ALTER TABLE <table> ADD COLUMN <definition>` form
everything behind `--` is commented out, so the statement ends up
incomplete. This also hits fields generated from TCA through
`DefaultTcaSchema`, which makes it an upgrade blocker rather than
an edge case.

doctrine/dbal guards against this: `getSimpleAlterTableSQL()` falls
back to the table rebuild as soon as a column carries a comment.
TYPO3 never reaches that guard, because the type hint is appended
inside `getColumnDeclarationSQL()`, which runs after the check. The
column itself still has an empty comment at that point.

Instead of adding the hint earlier, the need for it is removed.
SQLite is dynamically typed and reports the declared column type
verbatim through `pragma_table_info`, so dedicated `JSON` and
`UUID` declarations can be used and mapped back on introspection.
No comment is written on SQLite anymore, and the failing statement
form is never generated.

Removing the type comment for SQLite from the platform trait is
part of the fix and not a follow-up cleanup: with the trait still
applied the hint is appended regardless of the declaration, and
the statement keeps failing.

Existing installations are unaffected. Columns created before this
carry `CLOB`/`CHAR(36)` plus the type comment and are resolved to
the same Doctrine type on introspection. Schema comparison uses the
generated column declaration, not the stored database type, so no
change is detected. A functional test covers this.

Review

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

Issues 2

Files 6

Review log 34

  1. Stefan Bürk uploaded patch set 1 09/02/26, 09:49

  2. core-ci voted on patch set 1 V +1 09/02/26, 09:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107589

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 09/02/26, 10:24

  4. Stefan Bürk merged patch set 2 09/02/26, 10:24