Review main Merged

64937[BUGFIX] Apply enableFields in JOIN's ON condition

Markus Klein CR +2 V +2 Normal +178 −32 updated 04/15/21, 12:30

Commit message

If an OUTER JOIN is requested, the "disabled" rows
of the joined table must be filtered before the join
is executed. Therefore the enableFields conditions
must be applied in the ON condition of the join.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Richard Haeser +1
    • Andreas Kienast +1
    • Henrik Elsner +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Martin Kutschker +1
    • TYPO3com +1 CI

Issues 1

Files 5

Review log 2429

Show 34 earlier messages
  1. Markus Klein uploaded patch set 1 06/25/20, 07:56

  2. TYPO3com voted on patch set 1 V -1 06/25/20, 08:08 Completed build in 11m 56s on Thu, 25 Jun, 08:08 AM Test Summary: 30 of 73353 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3985

  3. Helmut Hummel commented on patch set 1 CR -1 06/25/20, 11:38

    QueryBuilder.php:147

    We already have limitRestrictionsToTables. How is this different? I wouldn't introduce new API which is similar but not same as existing one.
  4. Markus Klein commented on patch set 1 10/06/20, 10:55

    This change is ready for review.

    QueryBuilder.php:147 Reply Unresolved

    It is different, because the limitRestrictionsToTables is a restrictioncontainer which can be replaced by the user anytime. For the bug here, we need to make sure that the user is not bothered with those details. Moreover, the restrictions are applied on the JOIN condition and not in the final where condition now. Therefore the user may still apply limitRestrictionsToTables in order to exempt those restrictions on the JOIN condition.
  1. Markus Klein uploaded patch set 2 10/06/20, 11:10

  2. TYPO3com voted on patch set 2 V -1 10/06/20, 11:10 Completed build in 24s on Tue, 6 Oct, 11:10 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6266

  3. Markus Klein uploaded patch set 3 10/06/20, 14:07

  4. TYPO3com voted on patch set 3 V +1 10/06/20, 14:28 Completed build in 17m 41s on Tue, 6 Oct, 02:28 PM Test Summary: 73791 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6282

  5. Markus Klein uploaded patch set 4 10/06/20, 22:15

  6. TYPO3com voted on patch set 4 V +1 10/06/20, 22:31 Completed build in 15m 18s on Tue, 6 Oct, 10:31 PM Test Summary: 73791 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6306

  7. Helmut Hummel commented on patch set 4 10/21/20, 14:23

    Connection.php:469

    this isn't really needed any more, is it?

    QueryBuilder.php:84

    I'd make this private and rename it to better reflect its purpose (restrictions already added by join).

    QueryBuilder.php:606

    If possible, I'd rather gather the information which tables are joined and modify the restrictions all at once in "addAdditionalWhereConditions" This way we'd make sure any other modification of the query in query builder will not work on a state not initiated by the user/developer
  8. Helmut Hummel commented on patch set 4 10/21/20, 14:26

    LimitToTablesRestrictionContainer.php:108

    hm, I don't really understand why this is changed here. can you help me out?
  9. Markus Klein commented on patch set 4 10/21/20, 14:35

    Connection.php:469 Reply Unresolved

    It is, to have proper type hinting! Our ExpressionBuilder does not inherit from the original one!

    QueryBuilder.php:84 Reply

    Ack

    QueryBuilder.php:606 Reply Unresolved

    I see no way to add the additional conditions to the various join conditions later. Do you know a way?

    LimitToTablesRestrictionContainer.php:108 Reply Unresolved

    Because this one throws an exception when this restriction container is used on the join-conditions, where on purpose not all queried tables are provided. Moreover, I see no reason why this should be a logic exception at all. I do not see a necessity that applicableTableAliases must be a full subset of queriedTables.
  10. Georg Ringer commented on patch set 4 10/22/20, 09:43

    Connection.php:469

    should we also add : ExpressinBuilder? the comment can IMO be removed then
  11. Markus Klein commented on patch set 4 10/22/20, 10:43

    Connection.php:469 Reply Unresolved

    Didn't do that due to backporting and stuff.
  12. Markus Klein uploaded patch set 5 11/16/20, 15:15

  13. TYPO3com voted on patch set 5 V +1 11/16/20, 15:28 Completed build in 12m 18s on Mon, 16 Nov, 03:28 PM Test Summary: 73629 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7357

  14. Andreas Kienast voted on patch set 5 CR +1 12/21/20, 09:46

  15. Benjamin Franzke commented on patch set 5 12/21/20, 13:12

    Connection.php:469

    getExpressionBuilder() and also `protected $_expr` are already defined by \Doctrine\DBAL\Connection. Why are they needed here?
  16. Benjamin Franzke commented on patch set 5 12/21/20, 13:13

    Connection.php:469 Reply

    nevermind, saw the resolves comments now.
  17. Georg Ringer voted on patch set 5 V +1 CR +1 03/10/21, 21:58

  18. Richard Haeser voted on patch set 5 CR +1 03/17/21, 12:09

  19. Martin Kutschker voted on patch set 5 V +1 03/19/21, 19:34

  20. Benni Mack commented on patch set 5 03/22/21, 19:21

    I would refrain to putting this in to 9.5. Any other opinions?
  21. Markus Klein commented on patch set 5 03/22/21, 20:01

    Reply

    No hard feelings. Whatever you consider right/best.
  22. Benni Mack commented on patch set 5 04/07/21, 20:13

    OK. go for it (incl. 9.5)
  23. Henrik Elsner voted on patch set 5 CR +1 04/15/21, 12:23

  24. Georg Ringer voted on patch set 5 V +2 CR +2 04/15/21, 12:30

  25. Georg Ringer merged patch set 6 04/15/21, 12:30