Review 11.5 Merged

74309[BUGFIX] Avoid unreliable 'rowCount()' in RedirectRepository

Oli Bartsch CR +2 V +2 Easy +1 −1 updated 04/25/22, 19:23

Commit message

rowCount() on result sets for SELECT queries are not reliable
across all dbmns, which doctrine/dbal comments in the docblock.
See: https://github.com/doctrine/dbal/blob/110ab1387f11ca08dd510850d1f45bc6e79c74bb/src/Driver/Result.php#L77

Because of "rowCount()"'s unreliable behaviour for some dbms like
sqlite, this should be avoided to ensure cross dbms support.

This patch mitigate this with a simple COUNT() query replacement
in '\TYPO3\CMS\Redirects\Repository\RedirectRepository' for the
"ext:redirects", as this can be done without greater API changes.

Other occurrences will be mitigated with dedicated patches and the
proper suitable solution for the corresponding case.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Oliver Klee +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 56

  1. Oli Bartsch commented on patch set 1 04/22/22, 17:47

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 04/22/22, 18:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26313

  3. Stefan Bürk voted on patch set 1 V +1 CR +1 04/23/22, 13:50

  4. Oliver Klee voted on patch set 1 CR +1 04/23/22, 20:13

  5. Oli Bartsch voted on patch set 1 V +2 CR +2 04/25/22, 19:23

  6. Oli Bartsch merged patch set 2 04/25/22, 19:23