Bug #103348
closedDatabase analyser doesn't detect sub type changes
100%
Description
Hi there,
I'm having problems with the database analyzer:
When I try to change a field from text (tiny/text/medium) to another text "size" (eg. tinytext -> text | tinytext -> longtext), the updater just doesn't recognise the change.
I've tested this problem on a fresh and clean V12 instance to avoid interference from another extension, just by modifying a core ext_tables.sql files.
Christophe
Files
Updated by Christophe Monard 9 months ago
- Tags changed from Install Tools to Install Tools, database analyser, database updater
Updated by Stefan Bürk 8 months ago
- Category changed from Install Tool to Database API (Doctrine DBAL)
- Assignee set to Stefan Bürk
Confirmation¶
Confirmed - only related to TYPO3 v12 / Doctrine DBAL 3.
Analysis¶
This is related to the Doctrine DBAL 3.x upgrade in TYPO3 v12,
which is a intermediate release from the Doctrine Team and marks
the Deprecation/Preparation "Major" version between v2 and v4.
The result is, that the Doctrine DBAL 3.x contains some quirks
and deprecation, with dual code branch execution and doublings.
Related to this issue are the extended classes required for the
TYPO3 Database Analyzer workflow.
\TYPO3\CMS\Core\Database\Schema\Comparator
extends the DBAL\Doctrine\DBAL\Schema\Comparator
, and Doctrine DBAL changed
the inner parts of the comparator. The `diffColumn()` is marked
as deprecated and vanish with Doctrine DBAL 4, which will be
superseeded by the `columnsEqual()` dispatcher method, which
calls the `AbstractPlatform->columnsEqual()` method, if the
platform is set in the comparator.
Comparator instance creation without a platform is deprecated,
but has been allowed in the past. Due to the deprecation layer
for `compareSchemas()` and static -> non-static deprecation
move the platform is not passed down to the inner comparator
and checks pased on the platform are not executed.
That means, that the length check is not properly done due in
the overriden diffColumn()
method, but passing the platform
through would dispatch the columsEqual()
method which does the
comparison in other ways and leading to some noise, which can't
be properly handled in a bugfix safe way (and is still a open
issue for Doctrine DBAL 4 and TYPO3 v13).
However, this issue relates to an oversight and missing the
not available platform during the static to non-static compat
layer.
Possible fix(es)¶
Only possible way to fix this as a v12 bugfix I can see would
be:
- pass the platform to the
compareSchemas()
call in the core
ConnectionMigratior::buildSchemaDiff()
method as 3rd param
and use it for thenew self()
to pass the platform to the
constructor - add a
columnsEqual()
method override to the extended
Comparator class and adding a check againstdiffColumn()
instead of using theAbstractPlatform::columnsEqual()
method for now and adopt the current workaround from v13.
That means that hidden database changes could popup after
the fix, leading to datbase changes - albeit being considerable
not breaking.
With that, TINYTEXT <-> TEXT <-> MEDIAUMTEXT <-> LONGTEXT changes
are regonized again and can be applied.
Updated by Gerrit Code Review 8 months ago
- Status changed from New to Under Review
Patch set 1 for branch 12.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/+/83457
Updated by Gerrit Code Review 8 months ago
Patch set 2 for branch 12.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/+/83457
Updated by Christophe Monard 8 months ago
- File patchset.jpg patchset.jpg added
Patchset is working for me on v12 instance.
Updated by Gerrit Code Review 8 months ago
Patch set 3 for branch 12.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/+/83457
Updated by Stefan Bürk 8 months ago
Christophe Monard wrote in #note-6:
Patchset is working for me on v12 instance.
Would be nice if you would vote on gerrit for the latest set then - at least the +1 verified for testing that it works for you.
Updated by Christophe Monard 8 months ago
Updated by Stefan Bürk 8 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset dc392a4d46c9ee423304b3eca3a624a93b76c6e7.