mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Incorrect SQL generated for unidirectional many-to-many indexed extra lazy associations #6590
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gjdanis on GitHub (Dec 18, 2020).
I believe there's a bug in unidirectional many-to-many indexed extra lazy associations.
Specifically making the following change to
tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.phpAnd modifying a test to force a SQL query of the association:
Produces the following invalid SQL:
I believe a fix might be found in this PR: https://github.com/doctrine/orm/pull/8396
Currently it doesn't seem like the case where
$mapping['inversedBy']is null is accounted for. I'm not that familiar with Doctrine's internals but getting the inverse column from the association's mapping seemed to produce the correct SQL.@gjdanis commented on GitHub (Dec 22, 2020):
@beberlei would you be able to comment on whether this is a known problem and whether or not the proposed solution is in the right direction? Happy to contribute a PR but would be helpful to know if the problem/solution could be confirmed.