#105310\TYPO3\CMS\Core\Database\Schema\Parser\Parser translates CHAR to VARCHAR
Description
Given the following ext_tables.sql
CREATE TABLE table (
column CHAR(2),
);
the schema parser detects a char-type but it translates it into a doctrine/dbal type string without fixed set to true. So, this will be translated to
CREATE TABLE table (
column VARCHAR(2),
);
This would be fixed if the constructor of \TYPO3\CMS\Core\Database\Schema\Parser\AST\DataType\CharDataType sets its fixed property to true.
Alternatively, fixed could be part of the options passed into the constructor.
Reviews 6
- 13.4 90291[BUGFIX] Remove 14.0 changelog from v13
- 13.4 87656[BUGFIX] Create `CHAR` and `BINARY` as fixed length columns
- main 87584[BUGFIX] Create `CHAR` and `BINARY` as fixed length columns
- 12.4 87621[TASK] Use `VARCHAR` instead of `CHAR` in core `ext_tables.sql` files
- 13.4 87620[TASK] Use `VARCHAR` instead of `CHAR` in core `ext_tables.sql` files
- main 87596[TASK] Use `VARCHAR` instead of `CHAR` in core `ext_tables.sql` files
Related issues 4
History 722
-
Alexander Schnitzler changed Related to #103141 <span data-processor="relativetime" data-value="2024-10-15T07:57:03+00:00" > 10/15/24, 07:57 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 87584 status
NewUnder Review <span data-processor="relativetime" data-value="2024-12-23T16:45:32+00:00" > 12/23/24, 16:45 </span> -
Gerrit Code Review pushed patch set 2 for main to change 87584 <span data-processor="relativetime" data-value="2024-12-23T17:30:07+00:00" > 12/23/24, 17:30 </span>
-
Stefan Bürk changed Related to #105867 <span data-processor="relativetime" data-value="2024-12-28T12:19:29+00:00" > 12/28/24, 12:19 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 87584 <span data-processor="relativetime" data-value="2024-12-28T12:36:56+00:00" > 12/28/24, 12:36 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 87584 <span data-processor="relativetime" data-value="2025-01-02T10:33:10+00:00" > 01/02/25, 10:33 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 87584 <span data-processor="relativetime" data-value="2025-01-03T14:16:29+00:00" > 01/03/25, 14:16 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 87584 <span data-processor="relativetime" data-value="2025-01-06T13:18:30+00:00" > 01/06/25, 13:18 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 87584 <span data-processor="relativetime" data-value="2025-01-06T13:56:42+00:00" > 01/06/25, 13:56 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 87584 <span data-processor="relativetime" data-value="2025-01-06T13:58:43+00:00" > 01/06/25, 13:58 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 87584 <span data-processor="relativetime" data-value="2025-01-06T19:23:59+00:00" > 01/06/25, 19:23 </span>
-
Gerrit Code Review pushed patch set 10 for main to change 87584 <span data-processor="relativetime" data-value="2025-01-06T19:40:59+00:00" > 01/06/25, 19:40 </span>
-
Gerrit Code Review pushed patch set 11 for main to change 87584 <span data-processor="relativetime" data-value="2025-01-07T08:28:11+00:00" > 01/07/25, 08:28 </span>
-
Gerrit Code Review pushed patch set 12 for main to change 87584 <span data-processor="relativetime" data-value="2025-01-07T08:44:10+00:00" > 01/07/25, 08:44 </span>
-
Gerrit Code Review pushed patch set 13 for main to change 87584 <span data-processor="relativetime" data-value="2025-01-07T08:55:19+00:00" > 01/07/25, 08:55 </span>
-
Gerrit Code Review pushed patch set 14 for main to change 87584 <span data-processor="relativetime" data-value="2025-01-07T11:11:21+00:00" > 01/07/25, 11:11 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 87656 <span data-processor="relativetime" data-value="2025-01-07T12:35:04+00:00" > 01/07/25, 12:35 </span>
-
Stefan Bürk commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-01-07T12:50:09+00:00" > 01/07/25, 12:50 </span>Applied in changeset commit:ba10a6ed70de823c29dfe6c4cba71aa474c49390.
-
Oliver Bartsch changed Related to #107232 <span data-processor="relativetime" data-value="2025-08-08T08:13:44+00:00" > 08/08/25, 08:13 </span>
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:32:51+00:00" > 12/02/25, 14:32 </span> -
Georg Ringer changed Related to #110420 <span data-processor="relativetime" data-value="2026-10-17T05:52:22+00:00" > 10/17/26, 05:52 </span>
The problem with fixed CHAR is, that PostgreSQL behaves here
differently than MariaDB, MySQL and SQLite.
Postgres fills up the retrieved value with spaces to PAD the
value to the fixed length, the others will not do this.
Cross database queries like it have to be provided by TYPO3
itself MUST handle this difference(s) correctly and should
be avoid as much as possible using VARCHAR instead and have
the same behaviour accross all supported TYPO3 database vendors.