Review 13.4 Merged

88955[BUGFIX] Respect column `CHARACTER SET` AND `COLLATE` in ext_tables.sql

Christian Kuhn CR +2 V +2 Hard +322 −6 updated 04/07/25, 10:48

Commit message

With #104567 a basic support for table and column based
`COLLATE` and `CHARACTER SET` has been introduced based on
database connection `defaultTableOptions` for MySQL and MariaDB.

Having different `CHARACTER SET` and `COLLATE` on a column based
level is technically possible by the database systems `MySQL` and
`MariaDB`, but could not be configured until now.

One possible way to define the database schema is by providing a
file `ext_tables.sql` within extension folders using a subset of
`MySQL DDL` language.

This change extends `ext_tables.sql` parsing to read column specific
`CHARACTER SET` and `COLLATE` options following `MySQL` and `MariaDB`
definitions to allow setting options on a column level, different from
the connection, schema or table default settings. Further, internal
`ConnectionMigrator` is adjusted to ignore these settings for `SQLite`
and `PostgreSQL` due to compatibility issues and requiring not
compatible conversion definition and server installation requirements,
which cannot be expected to be available.

Configuring special per column character sets and collations remains
a rare usecase and should be used with care.

For the start `CHARACTER SET ascii COLLATE ascii_bin` is used for
table `sys_refindex` column `hash` to reduce required space for the
index using a single byte instead of multiple bytes per character.
This is possible since the hash field contains 'hex' ascii 0-9,a-f only.

This change is not considered breaking since applying the DB changes
is optional.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
  • Verified V +2 Done
    • Christian Kuhn +2
    • core-ci +1 CI

Issues 3

Files 8

Review log 34

  1. Christian Kuhn uploaded patch set 1 04/07/25, 10:31

  2. core-ci voted on patch set 1 V +1 04/07/25, 10:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77112

  3. Christian Kuhn voted on patch set 1 CR +2 V +2 04/07/25, 10:48

  4. Christian Kuhn merged patch set 2 04/07/25, 10:48