Review main Merged

87584[BUGFIX] Create `CHAR` and `BINARY` as fixed length columns

Stefan Bürk CR +2 V +2 Expert +994 −22 updated 01/07/25, 12:47

Commit message

In relational database management systems (RDBMS) using Doctrine
DBAL, `CHAR` and `BINARY` are fixed length fields, while their
counterparts `VARCHAR` and `VARBINARY` have variable lengths.
These are differentiated within Doctrine DBAL by the `StringType`
column option `fixed` (boolean).

TYPO3 parses `ext_tables.sql` files to define the virtual database
schema in the first step, tokenizing aforementioned types correctly
as different `AbstractDataType` and transforming them to Doctrine
DBAL Schema classes within the `TableBuilder`.

The `fixed` flag is now set to `true` for the `BinaryDataType`
and `CharDataType` and allows to define fixed sized columns for
these types.

Fixed char behaviour is not consistently handled across all
supported database engines, requiring different handling
dependant on the used RDBMS when creating and retrieving queries
on such columns.

Because of this, usage of `CHAR` or `BINARY` in TYPO3 Core should be
avoided to prevent requiring different code paths depending on the
used RDBMS. Specialized queries must be covered with functional tests
and use additional helpers, for example `ExpressionBuilder->trim()`
to ensure equal behaviour across all supported databases.

This bugfix allows to properly pass the `fixed` DBAL column option,
so that environments which do not need to deal with cross-RDBMS
support can utilize the `CHAR` and `BINARY` type columns. This is
usually the case in controlled project-environments or private
extensions.

An "important" Changelog item is added to describe this behaviour
and describe consequences and scenarios.

Review

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

Issues 1

Files 11

Review log 2641

Show 816 earlier messages
  1. Stefan Bürk uploaded patch set 1 12/23/24, 16:45

  2. core-ci voted on patch set 1 V -1 12/23/24, 16:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71572

  3. Stefan Bürk uploaded patch set 2 V -1 12/23/24, 17:30

  4. core-ci voted on patch set 2 V +1 12/23/24, 17:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71573

  5. core-ci commented on patch set 2 12/23/24, 17:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71574

  6. Stefan Bürk uploaded patch set 3 V +1 12/28/24, 12:36

  7. core-ci voted on patch set 3 V +1 12/28/24, 12:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71673

  8. Stefan Bürk rebased onto patch set 4 01/02/25, 10:33

    Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**")
  9. core-ci voted on patch set 4 V +1 01/02/25, 10:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71811

  10. Stefan Bürk rebased onto patch set 5 V +1 01/03/25, 14:16

  11. core-ci voted on patch set 5 V +1 01/03/25, 14:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71871

  12. Stefan Bürk uploaded patch set 6 V +1 01/06/25, 13:18

  13. core-ci voted on patch set 6 V +1 01/06/25, 13:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71985

  14. core-ci commented on patch set 6 01/06/25, 13:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71987

  15. Stefan Bürk uploaded patch set 7 V +1 01/06/25, 13:56

  16. Stefan Bürk uploaded patch set 8 01/06/25, 13:58

  1. core-ci voted on patch set 8 V +1 01/06/25, 14:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71991

  2. Garvin Hicking voted on patch set 8 CR +1 V +1 01/06/25, 19:23

  3. Garvin Hicking commented on patch set 9 CR +1 V +1 01/06/25, 19:23

    Published edit on patch set 8.
  4. core-ci voted on patch set 9 V -1 01/06/25, 19:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72000

  5. Garvin Hicking uploaded patch set 10 V -1 01/06/25, 19:40

    Adjust rendering of RST
  6. core-ci voted on patch set 10 V +1 01/06/25, 19:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72001

  7. Garvin Hicking voted on patch set 10 CR +1 V +1 01/06/25, 19:49

  8. Stefan Bürk voted on patch set 10 CR -1 01/07/25, 07:59

  9. Stefan Bürk uploaded patch set 11 CR +1 V +1 01/07/25, 08:28

  10. core-ci voted on patch set 11 V +1 01/07/25, 08:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72023

  11. Stefan Bürk uploaded patch set 12 V +1 01/07/25, 08:44

  12. Garvin Hicking voted on patch set 12 CR +1 V +1 01/07/25, 08:45

  13. core-ci voted on patch set 12 V +1 01/07/25, 08:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72027

  14. Stefan Bürk uploaded patch set 13 CR +1 V +1 01/07/25, 08:55

  15. core-ci voted on patch set 13 V +1 01/07/25, 09:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72028

  16. Garvin Hicking voted on patch set 13 CR +1 V +1 01/07/25, 09:56

  17. Christian Kuhn commented on patch set 13 01/07/25, 10:01

    currently discussing with stefan if we should target this to v12 ..
  18. Stefan Bürk uploaded patch set 14 CR +1 V +1 01/07/25, 11:11

  19. Stefan Bürk commented on patch set 14 01/07/25, 11:12

    Reply

    Removed 12.4. Maybe to "hot" for v12. If someone really needs that in a project they can backport that on their own using composer patches.
  20. Garvin Hicking commented on patch set 14 CR +1 V +1 01/07/25, 11:16

    Good for me. Personally: If someone picked "CHAR" in their ext_tables, even if it's a "breaking change" once it gets utilized, this is what people should expect in first place and be made aware off
  21. core-ci voted on patch set 14 V +1 01/07/25, 11:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72036

  22. Stefan Bürk commented on patch set 14 01/07/25, 11:19

    Reply

    It's only breaking when database changes are applied, and only for PostgreSQL. But fine to leave that out for v12.
  23. Christian Kuhn voted on patch set 14 CR +1 V +1 01/07/25, 12:00

  24. Stefan Bürk voted on patch set 14 CR +2 V +2 01/07/25, 12:34

  25. Stefan Bürk merged patch set 15 01/07/25, 12:47