Review 10.4 Merged

67058[BUGFIX] More deterministic mm sorting

Christian Kuhn CR +2 V +2 Easy +2 −0 updated 12/14/20, 17:31

Commit message

A 'true' MM relation (select / group with MM, but not inline
with foreign_field - used in core for pages/tt_content table
to sys_category via sys_category_record_mm) has two sorting
fields: 'sorting' for the local (sys_category) side, and
'sorting_foreign' for the foreign (pages / tt_content) side.

When categories are added to a tt_content element,
'sorting_foreign' is set to the given order of sys_category
elements. 'sorting' is set to 0. When then opening a
sys_category record that has multiple records pointing to
it with 0 as sorting, the returned order of records is
non-deterministic and depends on implicit DB engine fallbacks.

This also confuses the reference index, which checks
refindex integrity always from the 'local' side.

The patch adds 'uid_foreign' as second order-by field to
force deterministic ordering. There is still a possible
collision in multi table relations (more than one foreign
table uses the mm table like pages AND tt_content to
sys_category with foreign records having the same uid) and
if the mm table allows "multi" relations. Those scenarios
however have no explicit TCA configuration (only implicit
via MM_match_fields), need a deeper investigation and
possibly further detail patches later.

The patch should for now fix a functional test that is
flaky with postgres.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
  • Verified V +2 Done
    • Christian Kuhn +2
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 34

  1. Christian Kuhn commented on patch set 1 12/14/20, 17:17

    Cherry Picked from branch master.
  2. TYPO3com voted on patch set 1 V +1 12/14/20, 17:28 Completed build in 11m 26s on Mon, 14 Dec, 05:28 PM Test Summary: 75238 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC104-913

  3. Christian Kuhn voted on patch set 1 V +2 CR +2 12/14/20, 17:31

  4. Christian Kuhn merged patch set 2 12/14/20, 17:31