orm
orm copied to clipboard
ManyToManyPersister don't generate proper matching query for "in"
Bug Report
| Q | A |
|---|---|
| BC Break | no |
| Version | 2.16.2 |
Summary
Matching criteria in ManyToManyPersister (maybe other) doesn't work with "in".
Error is here:
https://github.com/doctrine/orm/blob/609647a51a1b28a674de270204a5cea3af57d554/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php#L257
Current behavior
When using in the value is not in using "(:value)" but just :value
Error would be something like this:
or the right syntax to use near '? LIMIT 1' at line 1
How to reproduce
Do a matching request with a criteria with in:
$this->collection
->matching(
Criteria::create()
->where(
Criteria::expr()
->in(
'status',
[$value1, $value2]
)
)
)
->count();
Expected behavior
Query shoudl be generated properly.
I stumbled over the same behaviour.
I'm using doctrine/orm:3.3.1 and doctrine/dbal:4.2.1
Please try #11895
@mpdude Works for me :thumbsup:
Didn't have time to test it but I have check the PR and it seems good 👍