Project

General

Profile

Actions

Bug #104781

closed

Database compare seems to be broken

Added by Philipp Kuhlmay 3 months ago. Updated 17 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Database API (Doctrine DBAL)
Start date:
2024-08-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
database
Complexity:
Is Regression:
Yes
Sprint Focus:

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


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Task #105208: Ensure correct type resolving in `AbstractSchemaManager`ClosedStefan Bürk2024-10-05

Actions
Related to TYPO3 Core - Task #104567: Apply `defaultTableOptions` to table columnsClosedStefan Bürk2024-08-07

Actions
Related to TYPO3 Core - Task #104573: Switch to Doctrine DBAL 4 comparisionClosedStefan Bürk2024-08-08

Actions
Actions #1

Updated by Philipp Kuhlmay 3 months ago

  • Description updated (diff)
Actions #2

Updated by Garvin Hicking 3 months ago

  • Category set to Database API (Doctrine DBAL)
Actions #3

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.

Actions #4

Updated by Stefan Bürk 3 months ago

  • Assignee set to Stefan Bürk
Actions #5

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).

Actions #6

Updated by Stefan Bürk 3 months ago

  • Status changed from New to Accepted
Actions #7

Updated by Guido Twieling 3 months ago

Hi.

Seems like dbal 4.1.0 problem. See https://forge.typo3.org/issues/104653#note-2

Actions #8

Updated by Benjamin Franzke about 1 month ago

  • Related to Task #105208: Ensure correct type resolving in `AbstractSchemaManager` added
Actions #9

Updated by Benni Mack about 1 month ago

  • Target version changed from 13 LTS to Candidate for Major Version
Actions #10

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)

Actions #11

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.

Actions #12

Updated by Benjamin Franzke 29 days ago

  • Related to Task #104567: Apply `defaultTableOptions` to table columns added
Actions #13

Updated by Benjamin Franzke 29 days ago

  • Related to Task #104573: Switch to Doctrine DBAL 4 comparision added
Actions #14

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

Actions #15

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

Actions #16

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

Actions #17

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

Actions #18

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

Actions #19

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

Actions #20

Updated by Benjamin Franzke 17 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF