Bug #104781
closedDatabase compare seems to be broken
Added by Philipp Kuhlmay 3 months ago. Updated 17 days ago.
100%
Description
Hi, I updated my current main branch from the TYPO3 core and now the database compare seems to be broken. I always get the entries for changing something in my database.
See Screenshot:
Even if I run it several times, the entries still remain there.
TYPO3 13 main branch
I did not change anything inside the database. Just updated my local git repo. It worked before.
Files
CleanShot 2024-08-30 at 10.26.00.png (210 KB) CleanShot 2024-08-30 at 10.26.00.png | Philipp Kuhlmay, 2024-08-30 08:27 |
Updated by Garvin Hicking 3 months ago
- Category set to Database API (Doctrine DBAL)
Updated by Garvin Hicking 3 months ago
(Note: There should be an issue report about this, I just can't research this atm, so only making this note). It's a known bug.
Updated by Stefan Bürk 3 months ago
For that exact one there is no current issue (as far as I know), but was known already.
However, already started working on that that (and the series of pre-patches).
Updated by Guido Twieling 3 months ago
Hi.
Seems like dbal 4.1.0 problem. See https://forge.typo3.org/issues/104653#note-2
Updated by Benjamin Franzke about 1 month ago
- Related to Task #105208: Ensure correct type resolving in `AbstractSchemaManager` added
Updated by Benni Mack about 1 month ago
- Target version changed from 13 LTS to Candidate for Major Version
Updated by Benjamin Franzke 29 days ago · Edited
Also seen this with ddev mariadb 10.4:
database: type: mariadb version: "10.4"
…which is surprising as we have an acceptance test https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Tests/Acceptance/Application/InstallTool/MaintenanceCest.php#L46 that assures that there are not db-comparision changes and this is executed with mariadb 10.4 in nightlies: https://github.com/TYPO3/typo3/blob/main/Build/gitlab-ci/nightly/acceptance-application.yml#L32
Doesn't matter whether a table uses utf8
or utf8mb4
, the comparison incorrectly assumes that schema and definition doesn't match, although they do.
(Seems like normalization doesn't normalize collate/charset correctly)
Updated by Benjamin Franzke 29 days ago · Edited
Another update:
This happens when defaultTableOptions
is not defined in DB.Connections.Default
.
That means it can be reproduced by dropping following lines from system/settings.php (or mitigated by adding 'defaultTableOptions'
)
'defaultTableOptions' => [ 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', ]
Note: .bin/typo3 setup
does not create a configuration with defaultTableOptions
by default (which seems to be another bug, as https://review.typo3.org/c/Packages/TYPO3.CMS/+/85658 commit message states that it should do that)
Edit: I can not reproduce this any more (Must have been a test error by myself – I probably tested sqlite instead of mysql) – but I think we still need a runtime default, not just a installtime default.
Also ddev default config is missing this configuration:
if (getenv('IS_DDEV_PROJECT') == 'true') { $GLOBALS['TYPO3_CONF_VARS'] = array_replace_recursive( $GLOBALS['TYPO3_CONF_VARS'], [ 'DB' => [ 'Connections' => [ 'Default' => [ 'dbname' => 'db', 'driver' => 'mysqli', 'host' => 'db', 'password' => 'db', 'port' => '3306', 'user' => 'db', ], ], ],
That means:
We should fix the case when defaultTableOptions
is not defined in the schema migrator – introspect database and read values via(?):
SELECT @@character_set_database, @@collation_database;
Edit: That means this issue has been introduced with #104567 + #104573.
Updated by Benjamin Franzke 29 days ago
- Related to Task #104567: Apply `defaultTableOptions` to table columns added
Updated by Benjamin Franzke 29 days ago
- Related to Task #104573: Switch to Doctrine DBAL 4 comparision added
Updated by Gerrit Code Review 28 days ago
- Status changed from Accepted to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86725
Updated by Gerrit Code Review 28 days ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86725
Updated by Gerrit Code Review 28 days ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86725
Updated by Gerrit Code Review 28 days ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86725
Updated by Gerrit Code Review 28 days ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86725
Updated by Gerrit Code Review 17 days ago
Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86866
Updated by Benjamin Franzke 17 days ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 1ed9954891bda07e01bb96050fd4fccc10afde5e.