Review main Merged

70877[BUGFIX] Ensure deterministic orderBy of CategoryCollection

Stefan Bürk CR +2 V +2 Easy +9 −3 updated 09/06/21, 13:33

Commit message

Missing deterministic orderBy for database queries leads to
different records retrieved across dbms and dbms version.
Some major dbms tends to order by primary key implictly,
where in newer versions it behaves differently. Even if
the database structure and data seems to look identically,
dbms tends to handle it in different ways.

Test fixtures for CategeoryCollectionTests do not provide
any values for sorting. Inserting the data to the database
is done through plain database inserts through the testing
framework, not taking care of table specific sorting fields
if test data missing them, which DataHandler and
RelationHandler takes care of in the core.

There can be instances with extensions omitting the usage
of datahandler and as such inserting nondeterministic datasets,
deterministic queries must be implemented.

Retrieving related records for categories has been missing
the required sorting field, so sorting was unreliable.

Ensuring deterministic record retrieval by adding
'uid_foreign' as last orderBy to kick in if two records
have the same sorting value.

This allows activation of a CategoryCollection related
functional test with postgres.

Even though the test data misses proper sorting field values,
this is not changed to ensure deterministic sorting does not
break again.

This patch acts as follow up for #95061.

$ Build/Scripts/runTests.sh -s functional -d postgres \
  typo3/sysext/core/Tests/Functional/Category/Collection/\
  CategoryCollectionTest.php

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Jochen Roth +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Jochen Roth +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 1220

  1. Stefan Bürk uploaded patch set 1 09/02/21, 21:54

  2. core-ci voted on patch set 1 V +1 09/02/21, 22:12 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16143

  3. Stefan Bürk updated the commit message in patch set 2 09/02/21, 22:29

  4. Stefan Bürk updated the commit message in patch set 3 09/02/21, 22:30

  5. Stefan Bürk updated the commit message in patch set 4 09/02/21, 22:32

  6. core-ci voted on patch set 2 V +1 09/02/21, 22:46 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16146

  7. Stefan Bürk updated the commit message in patch set 5 09/02/21, 22:50

  8. core-ci voted on patch set 4 V -1 09/02/21, 22:50 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16148

  9. core-ci voted on patch set 3 V -1 09/02/21, 22:52 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16147

  10. core-ci voted on patch set 5 V +1 09/02/21, 23:06 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16149

  11. Stefan Bürk rebased onto patch set 6 09/05/21, 10:38

  12. Oliver Klee updated the commit message in patch set 7 09/05/21, 10:52

  13. core-ci voted on patch set 6 V +1 09/05/21, 10:59 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16287

  14. core-ci voted on patch set 7 V +1 09/05/21, 11:11 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16288

  15. Christian Kuhn uploaded patch set 8 09/06/21, 12:46

  16. Christian Kuhn voted on patch set 8 V +1 CR +1 09/06/21, 12:47

  17. core-ci voted on patch set 8 V +1 09/06/21, 13:02 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16319

  18. Jochen Roth voted on patch set 8 V +1 CR +1 09/06/21, 13:33

  19. Christian Kuhn voted on patch set 8 V +2 CR +2 09/06/21, 13:33

  20. Christian Kuhn merged patch set 9 09/06/21, 13:33